How to find pivot position of a node?

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

In my game I am placing obstacle at runtime. My obstacles are sprites. When placing it inside of a 2d view port it gets miss placed. Is it because of improper pivot?

Any help? Thanks in advance.

That’s impossible to tell without knowing anything about your project, your code or how severe the misplacement is! Consider providing an example project or at least some screenshots that detail the problem and the settings you chose.

By default, a Sprite’s pivot point is exactly at it’s center!

njamster | 2020-09-15 09:15

:bust_in_silhouette: Reply From: klaas

The pivot is allways on position 0,0 in local space
The global position of the pivot is at sprite.global_position.

The pivot is visualized with a small cross.
The “actual sprite” has an offset, defined under offset