attach this script to a vive controller in the teleport demo, move your character around with it, and try to teleport. The origin is not where it should be once the camera rig gets moved.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HTC.UnityPlugin.Vive;
public class ViveControllerMovement : MonoBehaviour
{
public ViveRoleProperty viveRole;
public GameObject CameraRig;
public ViveRoleProperty controllerDirection;
void Update()
{
if (ViveInput.GetAxis(viveRole, ControllerAxis.PadY) > 0.5f)
{
Vector3 movementVector = Vector3.ProjectOnPlane(VivePose.GetPose(controllerDirection).up, Vector3.up);
CameraRig.transform.position -= movementVector / 3;
}
if (ViveInput.GetAxis(viveRole, ControllerAxis.PadY) < -0.5f)
{
Vector3 movementVector = Vector3.ProjectOnPlane(VivePose.GetPose(controllerDirection).up, Vector3.up);
CameraRig.transform.position += movementVector / 3;
}
if (ViveInput.GetAxis(viveRole, ControllerAxis.PadX) > 0.5f)
{
Vector3 movementVector = Vector3.ProjectOnPlane(VivePose.GetPose(controllerDirection).right, Vector3.up);
CameraRig.transform.position += movementVector / 4;
}
if (ViveInput.GetAxis(viveRole, ControllerAxis.PadX) < -0.5f)
{
Vector3 movementVector = Vector3.ProjectOnPlane(VivePose.GetPose(controllerDirection).right, Vector3.up);
CameraRig.transform.position -= movementVector / 4;
}
}
}
attach this script to a vive controller in the teleport demo, move your character around with it, and try to teleport. The origin is not where it should be once the camera rig gets moved.