- Home /
OnTriggerEnter smooth Rotate
Hello guys! I use this script for rotation my gameobject after every collision, but i dont understand how to make my rotatio smooth??
function OnTriggerEnter (other : Collider) {
if (other.tag == "1FLTrigger"){
transform.Rotate (0, -10, 0);
}
}
I've try also use this
transform.rotation = Quaternion.Slerp (transform.rotation, Quaternion.Euler(0, 10, 0), 20.0);
But i can't figure out how to correctly set Quaternion.Euler - i need, that after each collision it turn about 15 degrees( Thanks in advance!)
Answer by cdrandin · Jan 14, 2013 at 07:47 PM
The answer provide her is good info. http://answers.unity3d.com/questions/227934/quaternionslerp-question-rotating-back-to-original.html the thing to note is that Slerp needs times to rotate to a position so you will need some condition to allow it to make is full rotation or you can simply use yield or coroutine and wait it out.
Your answer
Follow this Question
Related Questions
How to rotate your device and counter rotate camera 0 Answers
Smoothly Rotate the Object 0 Answers
Smooth Camera Rotate 2 Answers
Smoothly stop rotating 1 Answer
smooth fps movements using joystick 1 Answer