what is wrong with this code

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Castor1010

Hello Everyone,
I am new on godot and i have a question
What is wrong with this code

extends KinematicBody2D

var velocity = Vector2.ZERO

onready var animationPlayer = $AnimationPlayer
onready var animationTree = $AnimationTree
onready var animationState = animationTree.get(parameters/playback)

const ACCELERATION = 500
const MAX_SPEED = 80
const FRICTION = 500

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.set("parameters/Idle/blend_position", input_vector)
	animationTree.set("parameters/Run/blend_position", input_vector)
	velocity = velocity.move_toward(input_vector * MAX_SPEED, ACCELERATION * delta)
	animationState.travel("Run")
else:
	animationState.travel("Idle")
	velocity = velocity.move_toward(Vector2.ZERO, FRICTION * delta)

velocity = move_and_slide(velocity) 

this code doesn work
onready var animationState = animationTree.get(parameters/playback

Can anywone explain me

:bust_in_silhouette: Reply From: Nirmal

Did you quoted (“parameters/playback”)

what do you mean

Castor1010 | 2020-12-27 09:10

He means in your code:

onready var animationState = animationTree.get(parameters/playback)

Should be:

onready var animationState = animationTree.get("parameters/playback")

you forgot the quotation marks.

rcub3161 | 2020-12-27 22:27

:bust_in_silhouette: Reply From: rcub3161
onready var animationState = animationTree.get(parameters/playback)

Should be:

onready var animationState = animationTree.get("parameters/playback")

you forgot the quotation marks.

:bust_in_silhouette: Reply From: abcd1231406

“parameters/playback”