Snapping a gun to character, wont work

hi, i am trying to make a platform game with similar shooter mechanics to the conviction of gun dude. I did manage to get the the gun to rotate towards the mouse, and i used the “set position to” action to snap it to the player, but, alas, it snaps only while not moving and while jumping and falling. When the player is walking the gun snaps to the player sprite origin(and yes i did move the origin to the right spot to try to fix this), and when player stops the PLAYER snaps to the middle of the gun, moving the player a fair amount. I even tried to lerp the gun to the player.

Hi, it would be very helpful for everyone in the forum to see your events.

ok i will do that as soon as i figure out how to take screenshots on windows 11

ok, the top event is the one bothering me. and also, i have the same problem with and without lerp, i just like the look of lerp with the gun. no other events affect the gun position.

I have tried your events and it works as intended.

That’s actually not necessary. You can create a custom point for your gun at the player-sprite. Maybe you can try that and see if there is any difference?

ok let me give that a try.

ok i gave it a try, but the gun now snaps to the players top back side but does not move the player. before hand it stayed on the left.

I see. That’s very strange. As mentioned, for me everything works as it should. The only thing I can think of is maybe to delete your sprites and load them again into the editor and to set up a test scene only with the gun positioning events.

Ok, i will try that tomorrow, also i there is a possibility that this happens because i changed the origin of the gun, i will get back to the forum as soon as i have tried these

very strange. i copied and pasted all the necessary sprites, and voila! All worked as it should. however, once i put all the other events into the scene, it made the same error as the first one.

(just a continued snapshot of all the events)

In this case I would start with the gun set up in the scene again and add successively the other events until the point when the problem occurs.
On a side note: you don’t need the ‘Always’-condition. As far as I know this is a remnant from older Gdevelop versions. An event block without condition is executed always anyway.