Don't click here unless you want to be banned.

LSL Wiki : ExampleLookAt

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org
////////////////////////////////////////////////////////////////
// Look At
// by Jim Bunderfeld
// This script is open source. Please make changes as necessary.
// For best results, put this script in a cone.
////////////////////////////////////////////////////////////////

default
{
    state_entry()
    {
        llSetStatus(STATUS_PHYSICS,TRUE); // make the object physical.
        llSetHoverHeight(1.0,FALSE,1); // Object hovers at 1 meter above ground.
        llSensorRepeat("","",AGENT,10,PI,11); // Runs a sensor for an agent within 10 meters. It repeats every 11 seconds.
    }

    sensor(integer det)
    {
        vector pos = llDetectedPos(0); // Gets the pos of the nearest avatar.
        llLookAt(pos,1,1); // Point the object to pos.
    }
}
Comments [Hide comments/form]
I just changed the sensor repeat interval from 0.1s to 10s. 0.1s sensor repeat intervals are a heavy use of community resources, and I'm hesitant to see it used an any example of how things "should" be done, like this Wiki.
-- ChromalBrodsky (2004-04-26 16:10:18)
i made a slight variation to this script and now it acts like a fake security camera in my lobby.

default
{
state_entry()
{
llSetStatus(STATUS_PHYSICS,TRUE); make the object physical.
llSetHoverHeight(1.0,FALSE,1);
Object hovers at 1 meter above ground.
llSensorRepeat(, , AGENT, 10, PI, .01); Runs a sensor for an agent within 10 meters. It repeats every 11 seconds.
}

sensor(integer det)
{
vector pos = llDetectedPos(0);
Gets the pos of the nearest avatar.
llLookAt(pos,1,1); Point the object to pos.
vector nOffset=<-1,0,0>;
vector nPos = llDetectedPos(0);
nPos +nOffset;
llMoveToTarget(nPos,.1);
}
}


Just Physical to false in the menu and it will stay off the ground. Or you could set it to false in the hard coding..
-- c-76-108-212-13.hsd1.fl.comcast.net (2007-12-13 18:11:50)
Attach a comment to this page: