- Home /
Question by
adrianangeloabelarde · Apr 22, 2020 at 07:06 PM ·
rotationnot workinganglemousepositionflipping
How can I fix this randomly rotating gun to an unknown degrees?
I'm sorry I am bad at English* and beginner on unity
So I have this gun and i want to flip it as soon as the gun points towards 90 degrees and turn the flip off when it goes 270. But turns out that my gun points to random position and i don't know what to do.
This is my script:
https://drive.google.com/open?id=1vlptDnoS3XySh8bHgAxkSOYS_ujkBkrW
And this is what is happening;
https://drive.google.com/open?id=1B3Bh6nVwiG8-l2do-Ve1Q-rW3BwhjIVV
Thank you! :<
Comment
Answer by zactanpeterson · Apr 22, 2020 at 07:19 PM
it looks like you want to flip it when it's facing left and right, If so you need to flip it when it hits 0 and 180 degrees instead of 90 and 270.