milunax
❔ Clamp on rotation depending on the side facing - Unity2D
Hi guys, i'm new to C# and I got a problem I can't solve. I'm making a 2D plateformer game and I want my player to aim with his mouse BUT I don't want it to be able to fire in the back of the character. So i'm trying to clamp the rotation of my fire point verticaly at a 180° angle. When the character is facing to the right it works just fine but when the character is facing to the left my clamp is either not rotation or is doing half the job. So i'm kinda out of ideas to solve this. Any help or suggestion would be appreciated !
Here is my code so far :
2 replies