How to make a botton inserts a body

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

I want to know how I can make the user mark a space in the ground and click a botton to insert a new body to the scene on the spot where the user marked. . Just like in maincraft

I’m not sure if I understand your question but you can connect a signal to your button
and then insert the desired into the scene by the signal function you connected to your button

CakeLover | 2022-02-13 08:59

:bust_in_silhouette: Reply From: rossunger

If you’re trying to make it just like in Minecraft youll need to be using a voxel engine. The closest equivalent in godot would be to use a gridmap, but this is not a simple task.

If you just want to place at object at a selected location, youll probably need to add a reassurance node from the camera facing in the direction of the camera, and when your button is pressed you check for a collision point using that raytrace, and instance a new object there.