Directs an object to travel to a defined position in the region or adjacent regions.

Syntax

void llNavigateTo( vector pos, list options );

Parameters

vector pos
position in region coordinates for the character to navigate to.
list options (instructions)
List of parameters to control the type of pathfinding used.

Adjacent regions can be reached by extending the position vector into the nearby region.

Constants

OptionValueParametersDefaultDescription
FORCE_DIRECT_PATH1[ integer boolean ][ FALSE ]Makes character navigate in a straight line toward pos. May be set to TRUE or FALSE.

Caveats

Examples

vector last_touched_pos;
key last_touched_key;

default
{
    state_entry()
    {
        llCreateCharacter([CHARACTER_DESIRED_SPEED, 50.0]);
    }

    touch_start(integer total_number)
    {
        last_touched_key = llDetectedKey(0);
        last_touched_pos = llList2Vector(llGetObjectDetails(last_touched_key, [OBJECT_POS]), 0);
        llNavigateTo(last_touched_pos, []);
        llSetTimerEvent(0.2);
    }

    timer()
    {
        vector last_touched_pos_now = llList2Vector(llGetObjectDetails(last_touched_key, [OBJECT_POS]), 0);
        if ( llVecDist(last_touched_pos_now, last_touched_pos) > 1 )
        {
            last_touched_pos = last_touched_pos_now;
            llNavigateTo(last_touched_pos, []);
        }
    }
}

Notes

(Needs verification.)

See also

Events

Functions

Deep notes

History

Date of Release 31/07/2012