17 lines
640 B
C#
17 lines
640 B
C#
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
public class VRPlayerRig : MonoBehaviour
|
||
|
|
{
|
||
|
|
public Transform headTransform;
|
||
|
|
public VRNetworkPlayerScript localVRNetworkPlayerScript;
|
||
|
|
private void Update()
|
||
|
|
{
|
||
|
|
if (localVRNetworkPlayerScript)
|
||
|
|
{
|
||
|
|
// presuming you want a head object to sync, optional, same as hands.
|
||
|
|
localVRNetworkPlayerScript.headTransform.position = new Vector3(this.headTransform.position.x, this.headTransform.position.y - 1.25f, this.headTransform.position.z);
|
||
|
|
localVRNetworkPlayerScript.headTransform.eulerAngles = new Vector3(0, this.headTransform.eulerAngles.y, 0);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|