GameObject Follow Avatar Script

I currently have a script that gets a cube to follow my avatar around the world. The problem is that when I turn the cube doesn’t turn with the character as I’d like. I don’t want to make the object a child of the avatar, rather just use this script to make it work. Any ideas what to add?

Code:

var objectToFollow;

function Update()
{
   objectToFollow = GameObject.FindWithTag("Player").transform;
   transform.position.x = objectToFollow.position.x;
   transform.position.y = objectToFollow.position.y+1;
   transform.position.z = objectToFollow.transform.position.z+2;
}

Well, what you could do is use something like this:

var objectToFollow;

function Update()
{
   objectToFollow = GameObject.FindWithTag("Player").transform;
   transform.position = objectToFollow.TransformDirection(-Vector3.forward * 4) + objectToFollow.position;
   transform.rotation = objectToFollow.rotation;
}