Hello! I’m pretty new here, I’m trying to make a shoot em up top down game, although I don’t know how to make the pistel rotate around the player, I want the pistel to aim towards the mouse as well. Any help would be appreciated!!!
Add action
Click on your gun
In searchbar in center type AROUND
Now select put the object around another
In right section choose your player
In distance put how far from your player gun should be
In angle put
AngleBetweenPositions(Player.CenterX(),Player.CenterY(),CursorX(),CursorY())
And you are set
What do you mean by glitching?
Like it starts jittering and getting out of control.
Sometimes just straight up flips the sprite.
As in the position changes rapidly, or the rotation goes haywire?
Rotation.
Are you using a touch device?
No, I’m not. I’m on PC.
Do you have multiple player obejcts on the scene?
Yes.
The issue is GDevelop doesn’t know which player to use for the co-ordinates.
Ideally you should have only 1 player object, and any other instances should be of a duplicate object of player object.
So you only have 1 player object on the scene, and don’t create a new player object at all?
If you run preview in debug mode, then you can see how many instances of player object are in the scene.
Have the events changed? Is there anywhere else where the gun (or player) is being repositioned?

I say it works perfectly fine
So screenshot to of your events and link to game preview plz
I used another method. Instead the sprite is just in the middle of the and doesn’t rotate around him, Its fine I guess. Sorry I wasn’t able to reply at the time of when you were talking. My account was made that day, so I reached my maximum amount of replies.


