KinematicBody2D bouncing off a RigidBody2D?

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

So I have a projectile that is supposed to bounce off a moving wall. So I have set the projectile to be a KinematicBody2D and the moving wall is a RigidBody2D.

Now, I know how to use the collision object returned from the move_and_collide method of the KinematicBody2D to bounce the projectile.

However, my problem now is that whenever the projectile hits the RigidBody Wall, it results in the Wall rotating around itself… which is fun but not intended.

So my question would be how to set up a RigidBody2D so that it can’t be moved by a KinematicBody.

:bust_in_silhouette: Reply From: p7f

For avoiding the RigidBody2D to rotate, you could put it in “Character” mode in the editor. See here

For avoiding kinematicbody2d to push the rigidbody, you should set infinite_inertia parameter of move_and_collide to false… see here