camera always behind player

Hello, i am learning about the camera and try start with a “static player camera”… How doing camera stay always behind player?

var offset : Vector3;

function Awake()
{
    offset = transform.position - player.transform.position;
}

function Update () {
    transform.position = player.position + (offset); 
}

a alredy try with:

transform.rotation = player.rotation

but the camera do not focuses directly on the player

Easy way is to just make the camera a child of the player.

Yes, I agree with that. However, it can not be done this way to be able to manage the whole scene with a single camera, so there is nothing else to deactivate a script or a function to change the view?

Try Transform.LookAt(Player.transform). to look at the player. That way you can keep the camera as a child of the player.

so glad I found this