Animation only plays on first collision.

Godot Version

4.3

Question

My object’s “Disturbed” animation only plays on the first collision with the player (the first instance of the object’s linear velocity being something other than 0)
Following collisions with the player, or with other objects do not trigger this “Disturbed” animation.

I want it to play the “Disturbed” animation whenever the object is moved. Thank you in advance for any help :slight_smile:

I have tried auto-transition between animation states through the animation tree but the same issue still persists.

Here’s the script I’ve written so far:

extends RigidBody2D

@onready var animation_tree = $AnimationTree
@onready var state_machine = animation_tree.get(“parameters/playback”)

func _physics_process(delta: float):
if linear_velocity.x!=0 or linear_velocity.y!=0:
state_machine.travel(“Disturbed”)