What does this mean and how do i fix this

Godot Version

4.5.1

Question

this happened in my code why i tried to run the scene, it didnt show an error but it gives an error when i try running it

this is the code i was writing:

class_name Player
extends CharacterBody2D

@export var speed : float = 50
@export var animation_tree : AnimationTree

var input : Vector2
var playback : AnimationNodeStateMachinePlayback

func _ready():
	playback = animation_tree["parameters/playback"]

func _physics_process(delta: float) -> void:
	var input = Input.get_vector("left", "right", "up", "down")
	velocity = input * speed
	move_and_slide()
	select_animation()
	update_animation_parameters()
	

func select_animation():
	if velocity == Vector2.ZERO:
		playback.travel("Idle")
	else:
		playback.travel("Walk")

func update_animation_parameters():
	if input == Vector2.ZERO:
		return
		
	animation_tree["parameters/Idle/blend_position"] = input
	animation_tree["parameters/Walk/blend_position"] = input

In your @export in the inspector did you assign a animations tree to the @export?

i set it now, but now it gives this error

image

Isn’t a error but a debugging tool. You accidentally clicked this in your script:

yeah i accidentally clicked it, thanks for the help

1 Like