- Edited
my wall jump is ok but my character can also climb kinda and i'm not sure how to avoid that.
any ideas ?
i use this for my ascending and falling state:
if !is_on_floor() and !is_on_wall() and !is_on_floor_only() and !is_on_wall_only():
#apply gravity
velocity.y += gravity * delta
if velocity.y < 0 :
_set_state(states.is_ascending)
if velocity.y >= 0:
_set_state(states.is_falling)
and this for the sliding state:
elif is_on_wall_only():
_set_state(states.is_sliding)
i dont put all my code but then my wall jump is like that: (i use another function for the usual jump)
func _wall_moves(delta):
velocity = Vector2.ZERO
direction = -wall_normal.x
if Input.is_action_pressed("jump"):
velocity = Vector2(wall_normal.x, jump_force)
did you encounter the same problem? i tryed a few stuffs but it didn't go as expected, i'm looking for the best method kinda.
how would you fix that?
thx.