【发布时间】:2018-12-27 05:27:35
【问题描述】:
我正在使用 Steam VR、VRTK 和 HTC Vive 统一制作 VR 应用程序。我有一个简单的重置按钮,我想要的是,当我单击该重置按钮时,我的 VR 相机应该转向目标游戏对象并开始查看它,这是我使用变换的代码。 LookAt 但它不起作用。
请帮助解决这个问题。
谢谢
using UnityEngine;
using System.Collections;
public class reset : MonoBehaviour
{
public Transform target;
public void resetview()
{
// Rotate the camera every frame so it keeps looking at the target
transform.LookAt(target);
}
}
【问题讨论】:
-
什么不起作用?它会给出具体的错误信息吗?
-
@RAB 没有错误消息我只想旋转我的 VR 相机来查看目标游戏对象,但我的相机没有移动或查看该游戏对象
标签: unity3d virtual-reality htc-vive