.set( ) Question

Godot Version

4.2

Question

how do you use .set( ) with the using the nodes properties

I am trying to use .set( ) to add to the scene’s y position but it seems to use the node with the script’s y position instead

this is the script I am using:
SceneInstance.set(Position, Vector2(position.x, position.y - 80)

Well position.y is is the same as self.position.y. So it would be using whatever self is.

But how do I change the target to be the instance?

is this C# or GDScript?

assuming GDScript, to get the SceneInstance’s position.y use SceneInstance.position.y. If you only want to set it to 80 lower than itself (subtracting 80), you can use the -= operator.

SceneInstance.position.y -= 80
1 Like