“Invalid call. Nonexistent function ‘travel’ in base ‘Nil’.”

Godot 4.2

Question
I Am just starting out with godot for the first time and am trying to follow a tutorial online for a top-down RPG game however I am being met with this error “Invalid call. Nonexistent function ‘travel’ in base ‘Nil’.” I have tried to fix this for a few hours but as I am new to this all I am not sure if I am just making a simple mistake or if there is a bigger problem at hand. Here is the code
" extends CharacterBody2D
@onready var animated_sprite = $Sprite2D
@onready var anim = $AnimationPlayer
@onready var animTree = $AnimationTree
@export var Speed: int = 50
@export var Friction: float = 0.15
@export var Acceleration: int = 40

var is_moving = false

#Called Every Frame. ‘delta’ is the elapse time since the last frame.
func _physics_process(delta):
var input_vector = Vector2.ZERO
input_vector.x = Input.get_action_strength(“right”) - Input.get_action_strength(“left”)
input_vector.y = Input.get_action_strength(“down”) - Input.get_action_strength(“up”)

velocity = input_vector * Speed


if input_vector == Vector2.ZERO:
	animTree.get("parameters/playerback").travel("Idle")
else:
	animTree.get("parameters/playerback").travel("Run")
	animTree.set("parameters/Idle/blend_position", input_vector)
	animTree.set("parameters/Run/blend_position", input_vector)

move_and_slide()

"

The error means that parameters/playerback animation tree parameter doesn’t exist. Check if you named parameters correctly. They are also case-sensitive.

1 Like