0 votes

I made a character with 3 CollisionShape2D ( "head", "body", "legs" ) and made it can jump through an one way collision platform.
As long as the player pass the platform entirely there are no problems.

But if the character stop jumping while it hasn't step over the platform with its legs, it will fall and get stuck when its body or head CollisionShape2D touch it.
How can I solve this?

The image below show the character's CollisionShape2D
Image of the collision shapes

Also, the platform is a StaticBody2D which is in the second layer only, while other StaticBody2D are in the first one and the character's mask is in both. I haven't found a way to set the head and body to be in the first mask only.

in Engine by (15 points)
edited by

I am getting this exact problem except I'm using a collisionpolygon2D for my player

1 Answer

+1 vote
Best answer

Is a design issue, you have 3 shapes for the floor, looks like they are different bodies for different use.

Is always better to have a single (and simple) shape for general collision, and different bodies/areas for other uses like hitboxes.

To keep it like this, I would make an Area over the 2 lower parts, if that Area is over a floor, move the main body a bit up (a raycast may be better, not sure).

by (7,922 points)
selected by
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.