每当我运行这段代码时,我都会遇到多个错误:
transform.rotation = Quaternion.FromToRotation (Vector3(0, 0, 0), Vector3(0, 0, 270));
你能建议修复这段代码吗?
错误:
Expression denotes a type', where avariable', value' ormethod group' was expected
The best overloaded method match for
UnityEngine.Quaternion.FromToRotation(UnityEngine.Vector3, UnityEngine.Vector3)
has some invalid argumentsArgument #1' cannot convertobject' expression to type
UnityEngine.Vector3
最佳答案
假设您使用的是 C#,您应该使用 new Vector3()
而不是 Vector3
关于c# - Unity 中的 Quaternion.FromToRotation 出错?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33468238/