![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Yozamu |
Hey there.
I have a player that can only jump when is_on_floor() is true.
No matter what I do, I can never jump (which could be caused by several factors) but I’ve checked the is_on_floor() result as a starting point for my debug.
I’ve checked the following thing:
# Compute stuff, and then do:
motion = move_and_slide(motion, upVector)
print(motion) # prints 0,0 all the time
print(is_on_floor()) # Once False, once True (regular)
print(position.y) # print a float that never changes
So there’s nothing that seem to change (no motion, no position change) but somehow the is_on_floor is alternatively false and true. I have a simple kinematic body 2D with
a capsule collider which stands on a static body with a polygon collider 2D.
Another point I wanted to mention is that I can rotate my sprite so the walls can become the floor; when I rotated several times, I saw that there was ONE direction where I could use the jump. Can’t understand why since everything is really symmetrical and squared, there’s no particular property anywhere