0 votes

I'm using RigidBody2D (Character mode) for a massive stone door that falls. Currently, if the player pushes it, it moves like it doesn't weight anything. The weight and mass properties in the inspector, doesn't help.


asked Jun 28, 2019 in Engine by chantunRey (30 points)

1 Answer

+1 vote
Best answer

Is your player a KinematicBody2D? If so this is because it has infinite_inertia enabled by default. See https://docs.godotengine.org/en/latest/classes/class_kinematicbody2d.html#class-kinematicbody2d-method-move-and-slide for details.

If you disable this, you won't be able to push the rigid body without applying a force to it.

answered Jun 28, 2019 by kidscancode (17,704 points)
selected Jun 28, 2019 by chantunRey

Thanks! that did the trick. Is there any cons of using it this way? Should I use a StaticBody2D and code the gravity instead? I believe the only thing I using from the physics engine is the gravity.

No, static bodies should not be moved at all.

There are always pros/cons between using rigid vs. kinematic. With kinematic, you'd need to apply gravity yourself, but you have more control over its movement.

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 How to use this Q&A? before posting your first questions.