I tried to make a Camera Follow script. The first thing i did was to set the position of the camera to the players position.
Here is the code i used in javascript:
var follow : GameObject;
function Update () {
var FollowTransform : Transform = (follow.gameObject.GetComponent(Transform));
transform.position = FollowTransform.position;
}
But when the game started the camera changed position to where the player was at the beginning of the game but remained there. The FollowTransform.position only returned the initial position of the player. What did I do wrong?