LlNavigateTo
首页 | 函数 | 事件 | 类型 | 操作符 | 常数 | Flow Control | Script Library | Categorized Library | Tutorials |
函数名 |
---|
Function: llNavigateTo( vector pos, list options ); |
参数:
• vector pos – position in region coordinates for the character to navigate to. • list options – List of parameters to control the type of pathfinding used. |
返回值:
将物体导向该区域或邻近区域中的一个确定的位置。 |
注意事项 |
---|
注意事项
|
示例 |
---|
示例一
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, []); } } } |
相关函数 |
---|
llCreateCharacter
[[[llPatrolPoints]] |
相关事件 |
---|
path update |