Unity if 语句中的四元数和 eulerAngles 问题
Issues with Quaternion and eulerAngles within if-statement in Unity
我一直在寻找答案并测试不同的东西,但它不起作用,所以我在这里询问。我得到的错误是
"Cannot modify the return value of 'Quaternion.eulerAngles' because it is not a variable"
这是代码:
void FixedUpdate ()
{
Quaternion rot = transform.rotation;
if (rot.eulerAngles.y =< 91)))
{
rb.AddTorque(transform.up * rotationStopper);
}
}
if (rot.eulerAngles.y =< 91)))
应该是
if (rot.eulerAngles.y <= 91)))
最上面的一个试图赋值给 y 变量但失败了,因为它不理解“< 91”是什么。
我一直在寻找答案并测试不同的东西,但它不起作用,所以我在这里询问。我得到的错误是
"Cannot modify the return value of 'Quaternion.eulerAngles' because it is not a variable"
这是代码:
void FixedUpdate ()
{
Quaternion rot = transform.rotation;
if (rot.eulerAngles.y =< 91)))
{
rb.AddTorque(transform.up * rotationStopper);
}
}
if (rot.eulerAngles.y =< 91)))
应该是
if (rot.eulerAngles.y <= 91)))
最上面的一个试图赋值给 y 变量但失败了,因为它不理解“< 91”是什么。