Turning the gun left and right on the character. Parent-child

Hi. I want the gun to follow the character as the character moves and rotate the gun when the character turns. I rotated the gun. But a problem occurs as you see below. I want the gun to have the same position when moving to the left as when moving to the right. How can I do it?

karakter

Hey!

Add condition: If Player is horizontally flipped = yes
Add action: change position of gun to X=Player.X()+a Y=Player.Y()+a
Add action: flip horizontally gun = yes

Add condition: If horizontally Player is flipped = no
Add action: change position of gun to X=Player.X()+a Y=Player.Y()+a
Add action: flip horizontally gun = no

for “a” use the value which fits the best for your need.

Thanks for your answer. I did it.

solution for those who need it:

1 Like

I personally haven’t found another way to do this but I also expected that when the object flipped so would the points. I wonder if there is an extension that already does this type of thing automatically?

I don’t know if such a plugin exists.