- Home /
Rotate along Z Axis
My current Rotation code:
Vector3 ld = loc - transform.position;
float a = Vector3.Angle(ld, Vector3.up);
transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.Euler(0,0,a), Time.time * .05f);
This works, some of the time. There are cases where I will get angles that should actually be 360 - angle (I think), but are instead just angle.
What is the correct way to handle this type of rotation?
Can you edit your post and describe in higher-level terms what you're trying to do? That is, what is the actual problem you're trying to solve?
Answer by DaveA · Jan 17, 2011 at 09:14 PM
I'd give this a try: http://www.unifycommunity.com/wiki/index.php?title=Angle
Your answer

Follow this Question
Related Questions
Camera rotation around player while following. 6 Answers
Rotation Problem 3 Answers
Use lookAt and transform.translate at the same time 1 Answer
pong rolling ball 1 Answer
Rotating and scaling children 1 Answer