Sticky Rotation Angles
Hi everybody,
imagine a script, which lets you controll a camera around a certain target. The script is not the problem.
I was wondering if there is a way to make some rotaion values "sticky".
Please look at the following picture (which is in no scale) to understand what I'm wanting to achieve: Instead of the interval from 250° to 290°, I always want lets say 270°. But outside that interval I want to have the actual rotation angel. I hope you understand what I meant.
Thanks for reading.
Break it into parts and refine the idea. If the angle is 280, should it snap to 270, or float? What if the user is still turning, etc... some of this you program first, test, and refine later.
How do you snap or float just regular numbers? Like an Inspector variable your can change, and goes to 10 if between 8 and 12. I guess in Update, but ... . Angles probably use the same idea.
How do you smooth/change angles? You can probably have the sticky code use the same math as the user spinning, or not. Try to get it to always go to 0, then add the limits later.
lets imagine the user constantly rotates. every time the rotation value gets to 250° the rotation smoothly floats to 270°. As soon as the user would have rotaded by 290° the rotation angle smoothly gets 290° and the player can controll the camera freely until the angle is again 250°.
Your answer
Follow this Question
Related Questions
Rotate character 0 Answers
Camera Rotation every time a key is pressed 0 Answers
Strange rotation behaviour 0 Answers
How can I make the camera not overreach a limit of rotation one axis. 0 Answers
using RayCast to aim at different planes 0 Answers