void OnTriggerEnter (Collider other) {
if (other.tag == "swordrange") {
rb.angularVelocity = new Vector3 (0f, 0f, 0f);
while (Quaternion.Angle(transform.rotation,qt)>.1f) {
transform.rotation = Quaternion.Slerp (transform.rotation, qt, .01f * Time.deltaTime);
}
}
}
qt is a quaternion value I stored from before, currently the object rotates to the quaternion qt but it does it instantly, any help?
↧