Rotate Object is Player near..

How i do that?

I want, if the player are near by my GameObject, it automatic Rotate. (But no more than 1x. Time)

Do have anyOne a script for me?

Thanks!

The fastest (performance wise) way to do this is to add a sperical trigger to your player with a radius equal to the distance you want.

then, add this to the object that rotates:

function OnTriggerEnter (other : Collider) {
if(other.transform.tag=="player"){     
var target=other.transform;

transform.LookAt(target);}

(this will only rotate it once, and is untested code)