- Home /
Question by
Zachery9111 · Feb 01, 2017 at 09:04 AM ·
c#rotationmouseposition
How can I make a game object follow my mouse cursor on the z-axis in 3D space, but snap at 45 degree angles and be clamped within a 180 degree radius? C#
I'm trying to make a "Contra" style shooter but in 3D, so I want my gun to follow the mouse cursor along the z-axis in 3D space to coincide with the screen, which it currently does, but now I want it to snap at 45-degree angles and be clamped to an 180-degree radius in front of the character. My code is in C#. This is the code that I have so far, thanks to another question that was posted on here.
codeforgame.jpg
(34.2 kB)
Comment
Your answer
Follow this Question
Related Questions
Flip over an object (smooth transition) 3 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Orbital cannon jitters while following/facing mouse position 1 Answer