how to make when 1 button is clicked it will run animation

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By shader

extends KinematicBody2D
export var spe = 150
var move1 = Vector2.ZERO

func _ready():
$AnimationTree.active = true

func _physics_process(_delta):
var move1 = Vector2.ZERO
if Input.is_action_pressed(“ui_left”):
move1.x -= 1
move1.y = 0

if Input.is_action_pressed("ui_right"):
	move1.x += 1
	move1.y = 0 

if Input.is_action_pressed("ui_down"):
	move1.x = 0
	move1.y += 1
	
if Input.is_action_pressed("ui_up"):
	move1.x = 0
	move1.y -= 1

move1 = move1.normalized()

if move1 == Vector2.ZERO:
	$AnimationTree.get("parameters/playback").travel("Stay")

else:
	$AnimationTree.get("parameters/playback").travel("Move")
	$AnimationTree.set("parameters/Stay/blend_position",move1)
	$AnimationTree.set("parameters/Move/blend_position",move1)
	move_and_slide(move1 * spe  )
:bust_in_silhouette: Reply From: heavyathan

In another post I read somebody solved this by exchanging:

$AnimationTree.set("parameters/Stay/blend_position",move1)

By:

$AnimationTree["parameters/Stay/blend_position"]=move1

Idk why as it should be the same.