Hello all,
I recently started working on a project for Oculus. I was wondering if someone has issues with camera following the player like me. I copied the script for camera movement from the tutorial section but the camera refuses to follow the object. I can look around when i run the game, but the player vanishes in the distance and the camera stays to its initial position.
Is there an issue with Oculus or do I have something set up wrongly?
Thank you in advance.
using UnityEngine;
using System.Collections;
public class CameraController : MonoBehaviour {
public GameObject player;
private Vector3 offset;
void Start ()
{
offset = transform.position - player.transform.position;
}
void LateUpdate ()
{
transform.position = player.transform.position + offset;
}
}
this is the script i copied from Unity Connect. But as i said above is not working…
I have the same issue. When I Oculus support is off the demo works correctly, however, after turning on oculus support the camera stays in one place. If I make the camera a child of the player I at least see the camera flipping as the ball rolls but then I add the script and the camera stays put.
The script looks perfectly fine to me. Have you chosen your CameraController in the editor and assigned Player to your rolling ball in the inspector?