Quaternion.Lerp甚至没有移动

Tat*_*ats 1 c# unity-game-engine

我想要旋转到旋转,new Quaternion(0,0,0,0);但它似乎没有动画到所需的旋转...它只是停在它的位置......

我试过的是下面的那三个

RectTransform rectTransformComponent = this.transform.GetComponent<RectTransform>(); rectTransformComponent.localRotation = Quaternion.Lerp(rectTransformComponent.localRotation, new Quaternion(0,0,0,0), 0.1f);

this.transform.localRotation = Quaternion.Lerp(this.transform.localRotation, new Quaternion(0,0,0,0), 0.1f);

this.transform.rotation = Quaternion.Lerp(this.transform.rotation, new Quaternion(0, 0, 0, 0), 0.1f);

我正在为这个对象使用RectTransform.它没有工作就行了.它在Update()中,因此它将在每一帧循环.我试图提高lerp的速度,但没有运气......

有人知道发生了什么事吗?

this.transform.localRotation = new Quaternion(0,0,0,0) //This works

Ed *_*rty 5

全零四元数(new Quaternion(0,0,0,0))是无效旋转.Quaternion.Lerp不知道如何插入到无效的旋转.

要旋转到欧拉旋转x = 0,y = 0,z = 0,那么您应该使用Quaternion.identity(相当于new Quaternion(0,0,0,1)).