Hi everyone! I am trying to move a RigidBody2D over a Path2D. However, I get a very strange behavior. When I print the global_position of my collider all seems to work fine. However, If I don’t do that, the collider seems to be still. Any clue?
I have a Node that has 2 childs: a Path2D and a RigidBody2D that has an animated sprite and a collisionShape2D.
Here the function:
That line should not have any impact on the movement of your shape.
The only thing I can think of is that the print statement eats a few blips of time and maybe allows a screen refresh or something like that.
Manually moving a physics body can cause issues for the physics server. So my first thought is that it is kinda working my coincidence when that print line exists.
I’m doing a similar thing (in 3D) and I have:
RemoteTransform3D as a child of a PathFollow3D
RemoteTransform3D has it’s remote path set to a RigidBody3D
RigidBody3D has props:
3.1 freeze = true
3.2 freeze mode = RigidBody3D.FREEZE_MODE_KINEMATIC
3.3 top level = true
This seems to be allowing me to move the RigidBody3D around the path without any issues.
Not sure if this is helpful, but thought I’d mention as it sounds like you are trying to accomplish the same thing I’ve done.
Hi! My RigidBody2D is not frozen. However, I agree that the issues are due to the wrong way I’m moving the body I solved the issue using a CharacterBody2D (and later still, not using path2D for this feature ).
Thank you, I will be more careful when moving stuff!