Godot Version
#Jump
if Input.is_action_just_pressed(“ui_jump”) and is_on_floor():
velocity.y += jump
anim.play(“Jump”)
floatUpTimer = 0
#Wall Slide
if is_on_wall() and not is_on_floor():
if Input.is_action_pressed(“ui_left”) or Input.is_action_pressed(“ui_right”):
is_wall_sliding = true
else:
is_wall_sliding = false
else:
is_wall_sliding = false
if is_wall_sliding:
velocity.y += (WallSlideGravity * delta)
velocity.y = min(velocity.y, WallSlideGravity)
anim.play(“Slide”)
wallJumpTimer += delta
#Wall Jump
if is_wall_sliding and Input.is_action_pressed(“ui_jump”) and wallJumpTimer >
velocity.y += jump
if Input.is_action_pressed(“ui_left”):
velocity.x = WallJumpPushBack
if Input.is_action_pressed(“ui_right”):
velocity.x = -WallJumpPushBack
anim.play(“Jump”)
wallJumpTimer = 0
#Floating up after the initial jump.
if Input.is_action_pressed(“ui_jump”) and floatUpTimer < MaxFloatTime:
velocity.y = floatUpVelocity
floatUpTimer += delta
anim.play(“Jump”)
#Prevent floating infinitely.
else:
floatUpTimer = MaxFloatTime
Question
so i have this code and it works well for me but i wanted to add something to the wall jump, where lets say i have 2 walls, the left and the right wall. If i jump off the right wall i want there to be a 1 sec timer before your next jump, which i have so you cant just climb jumping off the same wall. However, i wanted to make it so that if you jump from the right wall to the left then the timer is null. Idk i cant get my mind around the code to add, please help and if my code looks horrible im sorry i just started learning coding yesterday