Object Rotation, not facing the way I want

I am trying to do a very simple prototype but I found this problem:

  • My player rotates with the mouse
  • The player has a white mark. The white mark should always face the mouse.

In my snapshot you can’t see my mouse, but the player never faces the mouse with the white mark.

How can I accomplish this?

Keep in mind that the “0” position on an object, in regards to rotation, is facing directly right/due east.

If your object’s white mark is not the rightmost center side of the object, it will not rotate as you expect.

You can actually see the rotation/degrees chart on this page on the wiki: Basic game making concepts: What you need to know to start with GDevelop [GDevelop wiki]


So I think you are telling me to change the design of the player

Is there a way to not change my design and make it rotate from 270º?

Not easily, no. You could try using the “Rotate towards angle”, combine it with the “Object.AngleTowardsPosition” expression, and then add 270 to it, but then you’ll need to do that for any time you deal with angles going forward.

I’d recommend instead just rotating your object resources (images) to be facing right (instead of up) in an art editor.

Ok yes thank you. You are right it is much easier to just change the art

Thank you for solving my question

1 Like