Question by
unity_F4roCKCKLxjryw · Feb 12 at 01:14 PM ·
c#quaternionrotate object
Quaternion does not work
I can't figure out why my Quaternion isn't working and how I can fix it. want to rotate an object to an empty's object rotation but it doesn't work
private IEnumerator RotateOverTime(Transform hitTransform, float rotation, Quaternion EmptyRotation, GameObject AddRot)
{
if (!isTurning)
{
isTurning = true;
Quaternion startRotation = hitTransform.rotation;
hitTransform.rotation = Quaternion.Slerp(startRotation, EmptyRotation, Time.deltaTime * speed);
AddRot.transform.Rotate(0, -36, 0);
yield return null;
isTurning = false;
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613052930im_/https://answers.unity.com/themes/thub/images/avi.jpg)