Invalid set index 'parameters/TimeScale/scale' (on base: AnimationTree)

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

I got this error message while trying to reach the property:

Invalid set index ‘parameters/TimeScale/scale’ (on base:
AnimationTree)

extends KinematicBody

func _process(delta):
    var a = $AnimationTree["parameters/TimeScale/scale"]

The script is on a KinematicBody. The AnimationTree root is an AnimationNodeBlendTree with a TimeScale node. On the AnimationTree the tooltip indicates me the same path.
What I’m doing wrong?

Please post the code and question (and don’t show a screenshot of the code itself).

Ertain | 2021-05-24 23:28

Done. I removed the screenshot. Thanks.

FuLeZi | 2021-05-25 07:01

:bust_in_silhouette: Reply From: FuLeZi

My bad, I had an other node with the same script in the scene but not the same AnimationTree. Spending more time with the debugger was the solution.

Also my mistake comes from the fact that I found hard to understand from where the properties come from. And this code helped me:

func print_property_list(parent):
	print(parent.get_name())
	var list = parent.get_property_list()
	for prop in list:
		print("	> " + prop["name"])
	print("---")

func _process(delta):
	print_property_list($AnimationTree)