How do you position a object in 2D

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

I want to know how to position a object to x: 100 and y: 100 but I dont know how, and it says I have errors. Right now I am doing set_position(Vector2(100, 100))
I have tried many things like it and nothing worked. Please help…

“it says I have errors” - maybe if you shared what the errors were, we’d be able to help you. What kind of object is it that you’re using? The more information you provide, the easier it is to help.

kidscancode | 2020-08-14 04:47

:bust_in_silhouette: Reply From: mdubaisi

you can type:
“object”. global_position.x = 100
“object”. global_position.y = 100
or have a Position2D node and set the position of the object to the Position2D position:
“object”. global_position.x = Position2D. global_position.x
“object”. global_position.y = Position2D. global_position.y