![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | andersmmg |
I have some RigidBody objects I would like to be able to pick up and carry. I still want them to have physics and not go through walls and stuff, and not feel so stiff like when I just parent them to the player. How should I do this? Rotation doesn’t really matter.
I don’t really know and I’ve never tried that before but I would start experimenting with the following:
get the global coordinates of the camera’s local position+50 in the z axis, let’s call that position “target_position”. get the objects global position. use the get direction_to() function to get a vector that points from the objects global position to the target position. from the object move and slide towards the direction_to value you just go, so something like…
move_and_slide(self.global_transform.origin.direction_to(target_position))
zen3001 | 2019-12-05 19:03
I can’t use move_and_slide
, this is all in 3D (Spatial) and it’s a RigidBody…
andersmmg | 2019-12-05 19:50