![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Help Me |
Hello,
I’m trying to wall jump in a 2d platformer. I’d like for the character to move horizontally when they jump off the wall (i.e. diagonally). The character moves vertically smoothly and perfectly, but horizontally they “skip” and instantaneously jump from their current location to the new horizontal location. Thoughts?
if nextToRightWall() and !is_on_floor() and Input.is_action_just_pressed("jump" + action_suffix):
return Vector2(100, -500)
elif nextToLeftWall() and !is_on_floor() and Input.is_action_just_pressed("jump" + action_suffix):
return Vector2(100, -500)
else:
velocity.x = speed.x * direction.x