Get rotation from another object

Hey, guys i have a really stupid problem:

I just created a minimap which works pretty good
BUT i want to make the direction the player looks visible. For this i created a triangular plane and added a simple material to it.

The thing is: That plane should get its rotation from the player and the position from another object.

I tried diferent ways to achieve this but none seems to work.

Would be nice if someone could tell me how he/she would do it. Thanks!

Not sure on this, but,

arrow.rotation = GameObject.Find("player").transform.rotation;

Or something like that. You should be able to use GameObject.Find to get anything by object name in the hiearchy. O-o may be gameObject instead of GameObject… I can never remember which.

Thanks for the answer but unity doesn’t know the “arrow.rotation” thing. (Unknown Identifier ‘arrow’)

Okay, i figured it out! It’s that simple it hurts._.

LookDirection.transform.localEulerAngles.y=RefereToObject.transform.localEulerAngles.y

LookDirection is a GameObject Variabble for the Object which should be rotated.
ReferToObject is a GameObject variable from which i get the rotation.

Quite simple, huh? Maybe I’ve should read the scripting manual more carefully…

Anyway that Problem is fixed.

XD The arrow was supposed to be the arrow on the mini-map.

But you’ve found a way, so … :stuck_out_tongue: All is good. I forgot to put the .y on the end of them also.

Ohs well.