Directs an object to travel to a defined position in the region or adjacent regions.
void llNavigateTo( vector pos, list options );
Adjacent regions can be reached by extending the position vector into the nearby region.
| Option | Value | Parameters | Default | Description |
|---|---|---|---|---|
| FORCE_DIRECT_PATH | 1 | [ integer boolean ] | [ FALSE ] | Makes character navigate in a straight line toward pos. May be set to TRUE or FALSE. |
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, []);
}
}
}
(Needs verification.)
Date of Release 31/07/2012