- Home /
Question by
peteed · Apr 09, 2018 at 01:24 PM ·
2d gamerotatearoundpivot
How can I rotate around a point to match the direction of the xbox one controller joystick?
I'm trying to do a game like madness interactive from newsgrounds but am confused how to best do this.
Basically I have a gun that I need to rotate around the player so that it points top right if the joystick is in the top right and left if it points left and the like. I have a normalized vector of the direction the joystick is in however can't work out how to use that to rotate the gun around the player and stop while facing that same direction.
Any help appreciated.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612160405im_/https://answers.unity.com/themes/thub/images/avi.jpg)