The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates. | Twitter

0 votes

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 moveandcollide 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.

in Engine by (259 points)

1 Answer

0 votes

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

by (3,505 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.