Camera is Moving in Inspector but not in game?
Hi Folks. So I'm trying to get the camera to track the player without turning along with the player (not unlike the rolling ball tutorial).
My code is pretty simple for the camera
private Vector3 offset;
private GameObject player;
void Start () {
player = GameObject.FindGameObjectWithTag("Rotator");
offset = transform.position - player.transform.position;
}
void LateUpdate () {
transform.position = player.transform.position + offset;
Debug.Log(transform.position);
}
But the camera behaves like this https://www.youtube.com/watch?v=-z78d0gnm8M&feature=youtu.be
You can see that in the inspector and the Debug.Log console that the transform is clearly changing positions. But the camera does not move the slightest inch in game nor in the scene.
I'm at my wit's end here. What's going on?,
Answer by Spear99 · Nov 30, 2017 at 11:33 PM
Alright. With some help from Reddit (credit /u/ChevyNoel), I figured it out. Since this is a VR game, the camera is bound to the head movement. In order to move the camera, I have to parent it to another object, then move the object instead.
Your answer
Follow this Question
Related Questions
Roll a Ball game. Ball Rolling Diagonally 0 Answers
how to make forward relative to the view of the camera 0 Answers
Camera Modification Help 0 Answers
I have problems with scripting movement, anyone can help me? 0 Answers
Using Camera.main.ViewportToWorldPoint to limit player movement in the Y direction 0 Answers