How do I restrict the rotation of the Z axis for the "Player" to a certain extent? (2D)
Hello y'all! First question on Unity Answers so I apologize beforehand if I asked/did anything wrong. So for my 2D plat-former I have this "tank" which is the "player." Now while I was testing the game out I found it absolutely annoying that the tank would flip upside down and it would be very strange just watching it drive upside down. So I wanted to restrict the rotation about ~45 by Z axis so the 2D tank can't do back flips around the map. The example picture below shows what I would ~about like to restrict the tank from rotating. (The Blue represents the how much it can rotate while the empty space is where it can't rotate.)
My problem is the "Rigid Body" only allows me to FULLY restrict the Z axis, and while I have looked everywhere online for something that could help me out with solving the problem I ended up empty handed. I apologize if this is actually already answered on another forum I just couldn't find it.
Also if it wasn't already obvious I'm not very good at C# or Java... (So please have 0 hope for me.)
Thanks!
Your answer
![](https://koobas.hobune.stream/wayback/20220612100627im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity 2D- How to role a polygon? 0 Answers
Walking around 2D planets? 1 Answer
2D Joint motor ignores limits when rotated towards -x. 0 Answers