+1 vote

Hi,
I've inserted a sprite as child of a 2D Rigid body . From script I would rotate the parent item (Rigid body). But it seems that the center of rotation coincides with the origin of the 2D Node. Instead if I rotate from script only sprite, it rotates properly respect to its center. How should to do for rotating also parent respect to its pivot point ?
Thanks in advance and sorry for my poor english.
Regards
-jospic

in Engine by (1,484 points)
Do I understand correctly that you want to rotate Rigidbody around the manually defined rotation point of it's sprite child? As far as I know this is not possible, not sure what exactly is your setup but usually setting sprite position to 0,0 and checking 'centered' is a good idea for rigidbody2d->sprite setup.
Perfect!. Thanks

1 Answer

0 votes

Pasting my tip from the comment as an answer since the question still has 'unanswered' status and author seemed to be happy with my suggestion:
Not sure what exactly is your setup but usually setting sprite position to 0,0 and checking 'centered' is a good idea for rigidbody2d->sprite setup.

by (1,297 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 Frequently asked questions and 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 [email protected] with your username.