分清楚玩家根节点的位置和头(OVRCameraRig)的位置
VRTK_DeviceFinder.HeadsetTransform()
Player.Instance.transform.localPosition = ObjManager.instance.playerPos02.transform.localPosition;
Player.Instance.transform.localEulerAngles = ObjManager.instance.playerPos02.transform.localEulerAngles;
Player.Instance.HeadGoTo(ObjManager.instance.playerPos02.transform.position);Player.Instance.CamRigGoRoat(ObjManager.instance.playerPos02.transform.eulerAngles);
/// <summary>/// 以头为基准移动CamRig/// </summary>/// <param name="headPostion">想要让头去的位置</param>public void HeadGoTo(Vector3 headPostion){if (!Head)return;camRig.position = headPostion - Head.localPosition;}
public void CamRigGoRoat(Vector3 roat) {camRig.eulerAngles = roat;}
FR:海涛高软(hunk Xu)
QQ技术交流群:386476712