Quantcast
Channel: Questions in topic: "gun"
Viewing all articles
Browse latest Browse all 592

stop gun from rotating

$
0
0
I'm making a 2d platformer where the player has a gun and he can shoot. the gun is rotated according to the mouse and it works fine. what I want to do is that the gun won't pass the ground.. for example: this is the current state (the state i want to change): ![alt text][1] and this is the state I want to achieve: ![alt text][2] [1]: /storage/temp/18369-gunbad.jpg [2]: /storage/temp/18370-gundgood.jpg Now, I could do some kind of collisoncheck with the ground and then stop rotating the gun. but then there is still another problem: if the player jumps and then shoot down on the ground (which he can do), and then he falls back to the ground, when he lands the gun will stay at the same rotation and will touch the ground, so I need a way to check for a fixed rotation. Also, the platform can be rotated. Thanks a lot!

Viewing all articles
Browse latest Browse all 592

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>