0 votes

Sorry if i say something really dumb or obvious, i'm new to this game engine and to GDScript.

I have a simple KinematicBody2D player that moves left and right, and jumps. And an inanimate RigidBody2D node that doesn't have any behavior yet, so it's only affected by the engine physics. Since the rigid body is small compared to the player, i want the player to ignore the rigid body's force, and the rigid body to be affected by the player's actions. Right now the player just gets stuck when the rigid body falls above it.

May the solution to this be changing the player into a RigidBody2D as well?

in Engine by (29 points)

May the solution to this be changing the player into a RigidBody2D as well?

That could be one of them. But maybe the problem is that you are using move_and_collide instead of move_and_slide. Are you?

I'm using move_and_slide.

Using Kinematic is much more easier than using Rigid, but my character is supposed to act like a physical object affected by external forces that can rotate, rather than a typical platformer player. Maybe i'd just have to recode it to Rigid, it's just that the ''is on floor'' function is pretty useful and it doesn't seem to find it in Rigid.

1 Answer

+1 vote

Well now I think you should use a rigid body. You just need some changes to your code.

You should go check out the 2D physics platform demo.

by (3,912 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.