AnimationTree code not working

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

Hello i am trying to do a very simple Animation Tree Blend of just Idle and Run but this is not working correctly i am looking at the godot docs and i am using the following:

anim_tree["parameters/Seek/seek_position"] = 0.0

The error i get is this: Invalid call. Nonexistent function ‘set’ in base ‘Nil’

Im not sure what to do to attempt to fix this im still new to Animation Trees.

I think that means that anim_tree is null. What’s the line where you assign a value to it?

exuin | 2021-05-15 18:30

:bust_in_silhouette: Reply From: Kyle Szklenski

I know this is very old, but that simply isn’t how you set the parameters on an AnimationTree. The correct way to do it would be:

anim_tree.set("parameters/Seek/seek_position", 0.0)

In general, you have to use .get() and .set() with an AnimationTree to get or set parameter values.