LSL Wiki Mirror 7-7-7 : ExampleLookAt

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings ::
////////////////////////////////////////////////////////////////
// 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.
    }
}

Examples
There is one comment on this page. [Display comments/form]