Blend Position is setting but sprite isn't updating when spawning in new scene

Godot Version

4.3 beta 2

Question

I have a player script, my animations all work when walking and going back to idle. When I move from scene to scene it calls a set_spawn function which sets the blend positions of the animation_tree… When I print out those blend positions they are the correct Vector2’s but my player is always facing to the left at spawn and I can’t figure out why.

extends CharacterBody2D
class_name Player
#VARIABLES
@export var move_speed : float = 100.0 #Movement speed, exported for testing
var direction : Vector2 = Vector2.DOWN #Movement direction
#STATE
var current_state
enum state {IDLE, MOVE, PAUSE}
#ANIMATION_
@onready var animation_tree: AnimationTree = $AnimationTree
@onready var animation_player: AnimationPlayer = $AnimationPlayer

#SIGNALS
signal direction_changed

func _ready() → void:
animation_tree.active = true

func _process(delta: float) → void:
#Set direction to player input
direction = Input.get_vector(“left”, “right”, “up”, “down”).normalized()
if direction:
velocity = direction * move_speed
direction_changed.emit(direction)
current_state = state.MOVE
else:
velocity = Vector2.ZERO
current_state = state.IDLE
update_animation()

func _physics_process(delta: float) → void:
move_and_slide() #Moves the character

func update_animation():
match current_state:
state.IDLE:
animation_tree[“parameters/conditions/idle”] = true
animation_tree[“parameters/conditions/is_moving”] = false
state.MOVE:
animation_tree[“parameters/conditions/idle”] = false
animation_tree[“parameters/conditions/is_moving”] = true
#Set blend positions based on last user input
if direction != Vector2.ZERO:
animation_tree[“parameters/idle/blend_position”] = direction
animation_tree[“parameters/walk/blend_position”] = direction

func set_spawn(player_location : Vector2, player_direction : Vector2) → void:
position = player_location
direction = player_direction
direction_changed.emit(direction)
current_state = state.IDLE #Set player state
update_animation() #Update player animation
#Set blend positions manually (trying to get spawn direction working)
if direction != Vector2.ZERO:
animation_tree[“parameters/idle/blend_position”] = direction
animation_tree[“parameters/walk/blend_position”] = direction
#This is where I tried printing out the blend_positions and they show correct