If the player holds down the left mouse button, a box is on the screen. If you press T while holding down the right mouse button, an animation plays (the box makes a 360 turn). My only problem is that if I press T and release the left mouse button while the (360 turn) animation is playing, the box stays on the screen after the animation ends. Also the box has an appearing and disappearing animation. The code:
if Input.is_action_just_pressed("left_mouse_button"):
animation_player.play("appear")
if Input.is_action_just_released("left_mouse_button"):
animation_player.play("disappear")
if Input.is_action_just_pressed("T") and Input.is_action_pressed("left_mouse_button"):
animation_player.play("360turn")
Basicly it should be like: the player releases the left mouse button while the animation playing, after the 360 turn animation finished, the disappear animation plays or something like this, couldn't really figure it out.