gpt4 book ai didi

c# - Unity 中的 Quaternion.FromToRotation 出错?

转载 作者:太空宇宙 更新时间:2023-11-03 19:02:46 27 4
gpt4 key购买 nike

每当我运行这段代码时,我都会遇到多个错误:

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 arguments

Argument #1' cannot convertobject' expression to type UnityEngine.Vector3

最佳答案

假设您使用的是 C#,您应该使用 new Vector3() 而不是 Vector3

关于c# - Unity 中的 Quaternion.FromToRotation 出错?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33468238/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com