Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | jackash |
The question is pretty narrow but I can’t get the project to work from what I read in the official documentation.
I want to move a RigidBody
to some point on the screen where the mouse is if it’s colliding with another PhysicBody
(ground in my case), so I need a to cast a RayCast
to the point where the cursor is and then move an object to the collision point.
I found this in official documentation
var from = camera.project_ray_origin(event.position)
var to = from + camera.project_ray_normal(event.position) * 1000
That sort of gives me the mouse position in the 3D world, but what do I do next?