Access and Modify AnimationTree TimeScale Node?

Version 4.2.2

Hello there!

How do you access and modify the value of a TimeScale Node in an Animation Tree?

Mine looks like this:
image

And as an example, I can access and modify the current animation like so:

@onready var animNode = animTree.get_tree_root().get_node("CurrentAnimation")

@export var locomotionLibrary : String = "Player_Locomotion/"

func _process(delta):

animNode.animation = locomotionLibrary + "Walk"

So theoretically, I should be able to access the TimeScale node in a similar way, like so:

@onready var animSpeed = animTree.get_tree_root().get_node("AnimationSpeed")

But then what’s the equivalent to
image
for that purpose?

Got it- apparently you have to use AnimationTree.set(), which isn’t well documented:


@export var animTree : AnimationTree

func _process(delta):

animTree.set("parameters/AnimationSpeed/scale", 1)

AnimationTree.set()'s path is parameters/[Desired Node Name]/[Desired Node Value]

Although the Node Value always has a specific name that isn’t actually listed anywhere, from what I saw.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.