0 votes

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.

in Engine by (109 points)
edited by

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!

1 Answer

0 votes

Hi,
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

by (3,932 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.