Skip to content

Instantly share code, notes, and snippets.

@kkostenkov
Created August 11, 2016 11:38
Show Gist options
  • Save kkostenkov/e8a3bed9449d016a025af00fb1323354 to your computer and use it in GitHub Desktop.
Save kkostenkov/e8a3bed9449d016a025af00fb1323354 to your computer and use it in GitHub Desktop.
Script that uses HTC Vive cam position to set position of Perception Neuron in Unity.
using UnityEngine;
public class VrPosSync : MonoBehaviour {
public Transform viveCamEye;
public Transform neuronHead;
public Transform neuronPelvis;
void LateUpdate () {
Vector3 headPelvisOffset = neuronHead.position - neuronPelvis.position;
neuronPelvis.position = viveCamEye.position - headPelvisOffset;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment