【发布时间】:2020-10-16 05:27:31
【问题描述】:
我正在开发一个 android 应用程序,我将在其中放置基于地理位置的 3d 对象。这工作得很好。问题在于旋转,对象面向设备所面向的方向。我希望实例化的游戏对象面向地理北方向。我该怎么做? 我试过了
transform.rotation = Quaternion.Euler(0, -Input.compass.magneticHeading, 0);
它无法正常工作,显示方向错误。有没有其他方式游戏对象应该面向地理北方。
【问题讨论】:
-
只是为了确定:您是否检查过
Input.compass.enabled设置为true?
标签: c# android unity3d geolocation