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 physicsprocess(delta):
var inputvector = Vector2.ZERO
inputvector.x = Input. getactionstrength(“uiright”) - Input. getactionstrength(“uileft”)
inputvector.y = Input. getactionstrength(“uidown”) - Input. getactionstrength(“uiup”)
inputvector = 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: Favkis

You forgot " "
animationTree.get(“parameters/playback”)

THANK YOU SOOOO MUCH

Castor1010 | 2020-12-27 15:35

:bust_in_silhouette: Reply From: darkenopsia

nvm lmao i was wrong