can i get mouse position in tool mode?i want add mesh at the mouse position(like mine craft).

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By bgegg

i add this code, but it not work in tool mode, work in play mode.

func _input(event):

if event is InputEventMouseMotion:

print("Mouse Motion at: ", event.position)

I want to add a mesh at the mouse position.
I want to make a voxel editor like minecraft.

do i need 3d mouse position for this?

:bust_in_silhouette: Reply From: SL1200

I’m certainly no expert but have dabbled with modding MC before. From what I remember…
The mouse position alone will not work, make a radius around player that returns the position and side/face of the block your mouse is over.
Your mouse event should capture these values and pass them to your new block method. The new block method can then use the Vector3 as a position starting point and then use the side/face value to control the direction of the offset.

Hope this helps in some way

thanks.I did not know that I needed a 3d position.

bgegg | 2019-06-17 20:48