Jump to content

llLookAt


TonyBowlin
 Share

You are about to reply to a thread that has been inactive for 1913 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Alright, I've been staring at the screen for hours and I can't do it. I'm trying to make a look at ignoring the Owner if the Owner is closer than anyone else.

The goal was to make a spotlight on a vehicle and would look at everyone else and not the owner since the owner is a closer distance.

 

float range = 20;
float rate = 0.001;
float Position;                                                     
vector vel;                         
vector pos; 
vector DetPos;
vector MyPos;                      
rotation rot;
key id;                      

LinkedLookAt( vector Target,  key id)
{
    rotation rotvec = llRotBetween(<0,0,-1>,llVecNorm((Target - llGetPos())));
    rotation rotbet = rotvec/llGetRootRotation();
    llSetLocalRot(rotbet);
}
default
{
    state_entry()
    {
        llSensorRepeat( "", "", AGENT, range, PI, rate );
    }
    sensor( integer number_detected )
    {
        vector p = llDetectedPos(0);
        //key id;
        LinkedLookAt(p,id);

    }
}

Link to comment
Share on other sites

Not delving into the details here, just a hint: The sensor() event will detect up to 16 things, and sorts them in order of proximity. so llDetectedKey(0) is the key of the closest one, -Key(1) is the next-closest, and so on. So maybe test whether 0th key matches llGetOwner() as @Love Zhaoying suggests, and if it does, then try the 1st instead.

  • Like 2
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1913 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...