[SOLVED] Problem with rotation of a Sprite

There is something that I don’t get:
I have these two Sprites ( “A”, the one on the Left and “B”, the other on the Right)
and I want to rotate B of -90° and position it’s “Origin” on the “R” Point of A (on the Top Right, like in the last image).

When I rotate of -90° B I get this:
with that “Position” Point external to the Sprite.

And when I give the Action to put the Origin on the “R” Point I get this:
It’s NOT the “Origin” Point of B on the “R” Point of A, but the “Position” Point.

If I change The “Origin” Point in the Editor of the Sprite and put it in the Center of the Sprite then it’s all Ok: The “R” Point and the “Origin” are on the same position:
Obviously, the last 2 images have the same Events behind them (and only them! There are no other Events).

It’s nothing fatal and there are simples turnaround but I would like to understand if it’s a bug or is intended and why… what’s that “Position” Point and why it take precedence on the “Origin” point?


as no one else replied so far, I just give it a try based on the first image and the shown angle of sprite B. Problems with the rotation of sprites occur often because of the default angle of the sprite (the alignment of the sprite-png that you load into the scene). If it is not aligned horizontally, you will get weird results. It should look like this:

You can read about it here: Basic game making concepts: What you need to know to start with GDevelop [GDevelop wiki]

If you already knew that, then hopefully someone else can give a suggestion.

1 Like

From what I understand and can gather, the Position point is the where the origin is located when the sprite is first instantiated. The origin moves round as you rotated the sprite, but the position doesn’t. It appears to be fixed relative to the centre.

If you want to place the rotated sprite at the origin, I suggest you move the centre to the origin (and not the other way round).

1 Like

Right @MrMen That’s the solution!
The Rotation is always around the centre but the Position (“Origin”) doesn’t rotate and is always the same (the one from the default object)!
I think it should be better clarified in the wiki cause it can get things a lot messy.