Invalid call, nonexistent function 'travel' in base 'Nil'

Godot Version

`3.5

Question

I really don’t know where I’m wrong… Please someone help me.

type or paste code here
extends KinematicBody2D


export (int) var speed = 80


func _physics_process(delta):
	var input_vector = Vector2.ZERO
	input_vector.x = Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left")
	input_vector.y = Input.get_action_strength("ui_down") - Input.get_action_strength("ui_up")
	input_vector = input_vector.normalized()
	
	if input_vector == Vector2.ZERO:
		$AnimationTree.get("Parameters/playback").travel("Idle")
	else:
		$AnimationTree.get("Parameters/playback").travel("Walk")
		$AnimationTree.set("Parameters/Idle/blend_position", input_vector)
		$AnimationTree.set("Parameters/Walk/blend_position", input_vector)
		move_and_slide(input_vector*speed)
	pass

Parameters should be lowercase.

1 Like

Thanks very much!!!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.