0 votes

extends CharacterBody2D

@export var movespeed : float = 100
@export var starting
direction : Vector2 = Vector2(0, 1)

@onready var animation_tree = !AnimationTree

func ready():
tree.set("parameters/Idle/blendposition", startingdirection)

and how do i insert picture

Godot version Godot_v4.0.1
in Engine by (18 points)

1 Answer

+1 vote
Best answer

You set the value of animation_tree to !AnimationTree. This gets evaluated as a bool value, when you try to call the set function on the type bool, it throws an error since that type doesn't have that function.
You need to replace !AnimationTree with $AnimationTree if you want to reference a node in the scene.

You can insert pictures by uploading them to a public image sharing site like imgur, and using the image button in the text editor.

by (1,607 points)
selected by

Wow, thank you so much
Huh the tutorial code is too small that's why i see it wrong

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.