Hi, I need some help with my player animation so far everything was good until I add an idle animation and when I press any direction to walk the player won't change animation it's stuck in an idle frame.
Code of the animation below
#Player Animation
if (motion.length() > Speed_Idel*0.09):
if (Input.is_action_pressed("ui_up")):
Anim = "Walk_U"
if (Input.is_action_pressed("ui_down")):
Anim = "walk_D"
if (Input.is_action_pressed("ui_left")):
Anim = "walk_L"
if (Input.is_action_pressed("ui_right")):
Anim = "walk_R"
# problem starts here the animation won't change back to walking just idle
#Player walk in a idle state
else:
if (RayNode.get_rotation_degrees() == 180):
Anim = "Idle _U"
if (RayNode.get_rotation_degrees() == 0):
Anim = "Idle _D"
if (RayNode.get_rotation_degrees() ==-90):
Anim = "Idle _L"
if (RayNode.get_rotation_degrees() ==90):
Anim = "Idle _R"
if Anim != AnimNew:
AnimNew = Anim
PlayerAnimNode.play(Anim)