C# Unity中if语句中的四元数和EULERANGLE问题
我一直在寻找答案,测试不同的东西,但它不起作用,所以我在这里问它。我得到的错误是 “无法修改'Quaternion.eulerAngles'的返回值,因为它不是变量” 代码如下:C# Unity中if语句中的四元数和EULERANGLE问题,c#,unity3d,rotation,quaternions,C#,Unity3d,Rotation,Quaternions,我一直在寻找答案,测试不同的东西,但它不起作用,所以我在这里问它。我得到的错误是 “无法修改'Quaternion.eulerAngles'的返回值,因为它不是变量” 代码如下: void FixedUpdate () { Quaternion rot = transform.rotation; if (rot.eulerAngles.y =< 91))) { rb.AddTorque(transform.up * rotationStopper)
void FixedUpdate ()
{
Quaternion rot = transform.rotation;
if (rot.eulerAngles.y =< 91)))
{
rb.AddTorque(transform.up * rotationStopper);
}
}
void FixedUpdate()
{
四元数旋转=变换旋转;
如果(rot.eulerAngles.y=<91)))
{
rb.增加扭矩(transform.up*旋转停止);
}
}
if(rot.eulerAngles.y=<91)))
应该是
if (rot.eulerAngles.y <= 91)))
if(rot.eulerAngles.y不难,但它确实写在了错误中。Tj已经给出了答案;=
if (rot.eulerAngles.y <= 91)))