- Home /
Camera not Following Inspector's Value (Transform) When Play
Hi, Sorry for this, but I'm newbie. I swear.
I was learning by following the "Project" provided by Unity. The "Roll-a-Ball". Was learning the camera. I followed the video, but with different value. Then, found a problem.
So, with the inspector, I set the Position value with:
Because I wanted the camera view be like this:
But, when I tested it, I hit Play, the value changed by itself:
And the camera position:
The Main Camera is independent in the hierarchy. And the script for the camera:
using UnityEngine;
using System.Collections;
public class CameraController : MonoBehaviour {
public GameObject player;
private Vector3 offset;
void Start () {
offset = transform.position;
}
void Update () {
transform.position = player.transform.position + offset;
}
}
So, how to use the value I set and not changing when I hit play? Thanks, I'm noob, hope you understand XD
Your answer
![](https://koobas.hobune.stream/wayback/20220613172652im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to have controlles switch from FPC to a RC Car 1 Answer
Object doesn't stick on Camera right Corner?? (Basic Question) 1 Answer
Attaching an RTS scrolling script to a camera (Noob Question) 3 Answers
Shaking camera 0 Answers
How to add a script in the "Observed" variable of a "Network view" ? 2 Answers