Trying to animate a player in any version of godot

Godot Version

4.2

Question

`i dont understand why every version requires a different method for everything seems on purpose anyway heres what i got for 4.2

func _physics_process(delta):
direction = Input.get_vector(“left”, “right”, “up”, “down”)
if direction:
velocity = direction * SPEED
update_animation ()
else:
velocity.x = move_toward(velocity.x, 0, SPEED)
velocity.y = move_toward(velocity.y, 0, SPEED)

move_and_slide()

func update_animation ():
if(velocity == Vector2.ZERO):
$animation_tree[“parameters/conditions/idle”] = true
$animation_tree[“parameters/conditions/run”] = false
else :
$animation_tree[“parameters/conditions/idle”] = false
$animation_tree[“parameters/conditions/run”] = true
if direction != Vector2.ZERO:
$animation_tree[“parameters/idle/blend_position”] = direction
$animation_tree[“parameters/run/blend_position”] = direction `

its telling me invalid set index "paramiters/conditions/idle’(on base:‘null instance’)with walue of ‘bool’ and before you ask why im doing it that way its one of the 11 tutorials i followed