TonyBowlin Posted February 22, 2019 Share Posted February 22, 2019 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 More sharing options...
Love Zhaoying Posted February 22, 2019 Share Posted February 22, 2019 43 minutes ago, TonyBowlin said: LinkedLookAt(p,id); Try changing this to: If (id != llGetOwner()) LinkedLookAt(p,id); 1 Link to comment Share on other sites More sharing options...
Qie Niangao Posted February 22, 2019 Share Posted February 22, 2019 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. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
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