Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | abstractr |
I have a knife sprite which I’d like to rotate using custom rotation pivot, let it be knife’s handle center. I know it’s possible to change rotation pivot for Sprite
node, but the sprite is a child of CollisionPolygon2D
which has RigidBody2D
as its parent and toolbar button that changes object’s rotation pivot is disabled for CollisionPolygon2D
and RigidBody2D
, so I need to find another way.
So this is the hierarchy:
Node2D
RigidBody2D
CollisionPolygon2D
Sprite
Question: Can I have a Position2D
somewhere under RigidBody2D
to rotate CollisionPolygon2D
and Sprite
simultaneously? So that if the knife is flying I could still rotate it using my custom rotation point.