Invalid call. Nonexistent function 'set' in base 'bool'

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

extends CharacterBody2D

@export var move_speed : float = 100
@export var starting_direction : Vector2 = Vector2(0, 1)

@onready var animation_tree = !AnimationTree

func _ready():
animation_tree.set(“parameters/Idle/blend_position”, starting_direction)

and how do i insert picture

:bust_in_silhouette: Reply From: zhyrin

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.

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

ImTooLazy | 2023-03-24 12:06