Thought this would be simple

I want to place a object about 1mt in front of the player with the script from that object, then if the player moves or rotates the object will move and rotate with the player staying all the time 1mt in front and in view, I thought this would do it.

#pragma strict

var player : Transform;	// Reference to the player

function Awake(){

}

function Start () {

}

function Update () {
    
    transform.position = player.transform.position + Vector3(0,0,-1);
    transform.rotation = player.transform.rotation; 
}

But as I just found out it rotates around its own axis 1mt in front, can someone please point me in the right direction as my brains a bit fried :), Thanks.

PS … I don’t want to go down the road of child the object to the player as it’s already child of another object and will get destroyed quickly plus I already have a few objects child of the player.

transform.position = player.transform.position + player.transform.forward;