How To get/set Vector2 Properties Nested Values

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

Hey All,

I am very basically trying to do get("position:x") to only get the x value from the position property, but this code doesn’t work. (returns null). This is how the Docs say to grab this: Object — Godot Engine (stable) documentation in English

My actual use case is to set only the x value of a BlendSpace2D.

animTree.set("parameters/Running/BlendSpace2D/blend_position:x", value)

This doesn’t work, hence the post.

Even I am looking for the same issue. Kindly help if anyone have the solution.

nicholasjohn22 | 2021-03-16 17:19

:bust_in_silhouette: Reply From: Inces

You propably should convert it into NodePath with get_as_property_path()

:bust_in_silhouette: Reply From: godscock

You need to use the alternative [ ] syntax:

animTree['parameters/Running/BlendSpace2D/blend_position'].x = value