I was trying to develop a VR application and in the Game Mode on Unity, the camera follows the Player.
But when I build and deploy the app on an Andoird phone, the camera just stayed static while the Player moves around. Below is the script for the camera. Please advise.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewCamera : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
transform.position = target.transform.position;
}
public Transform target;
// Update is called once per frame
void Update()
{
transform.position = target.transform.position;
}
}
↧