direction compass

Happy New Year everyone!

I have a basic problem for which I can’t find a solution. I have a compass set up so when I rotate it, the rotation is passed on to the world and it rotates accordingly.

The camera is independent of the “world” and is merely observing it. However if I rotate the camera i would like for the compass to inherit it’s rotation. So in essence the world should read the compass rotation and the compass should read the camera rotation, but without passing it on to the world. (If that makes sense).

var world : GameObject; 
var compass : GameObject;

function Update () { 
     world.transform.rotation = compass.transform.rotation; 
}

Well, if you want full 3d transform copy, then attach the compass to a parent object, and rotate it using:

compass.transform.localRotation = camera.transform.rotation;