LlNavigateTo
De DigiWiki.
![]() |
Warning: This documentation is for the alpha release of LSL pathfinding. These LSL functions are available only on selected regions on the Aditi test grid, and not currently on the main grid. For more information, see Pathfinding/Alpha release notes. |
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
- FORCE_DIRECT_PATH can be used to rescue characters that have somehow fallen off the navigable zone as it doesn't use the navmesh.
(Needs verification.)
- The position vector can be set outside the current region by using extended range region coordinates: e.g., to go to the SE corner of the region to the East of the current one, you could llNavigateTo(<0.0, 512.0, 0.0>, []);
Also
- llCreateCharacter
- llDeleteCharacter
- llEvade
- llExecCharacterCmd
- llGetClosestNavPoint
- llFleeFrom
- llNavigateTo
- llPatrolPoints
- llPursue
- llUpdateCharacter
- llWanderWithin