i want to use a more realistic landing animation for my 2D plateformer game and i don't have a proper idea on how to implement it. any help guys ?
i tried this but it didn't help:

# falling state
extends state

func logic():
	.logic()
	if player.is_on_floor():
		next_state = states["jump_end"]
# landing state
extends state

func enter() -> void:
	.enter()
	player.timer_jump_end()
func logic() -> void:
	.logic()
	if player.is_on_floor():
		next_state = states["idle"]
  • newmodels i managed to do it and it looks great:
    #Landig
    extends state

    func logic():
    .logic()
    if player.is_on_floor():
    if player.motion.x != 0:
    next_state = states["run"]
    if jump:
    next_state = states["jump"]
    elif crouch:
    next_state = states["crouch"]
    else:
    yield(get_tree().create_timer(0.25),"timeout")
    next_state = states["idle"]

The design looks good, only. Are you waiting for the animation to end, or counting time? You should check to see if the animation has finished playing, then move into idle. Also, make sure the animation is not looping for the animation end check.

    newmodels i managed to do it and it looks great:
    #Landig
    extends state

    func logic():
    .logic()
    if player.is_on_floor():
    if player.motion.x != 0:
    next_state = states["run"]
    if jump:
    next_state = states["jump"]
    elif crouch:
    next_state = states["crouch"]
    else:
    yield(get_tree().create_timer(0.25),"timeout")
    next_state = states["idle"]