LlFleeFrom
| 首页 | 函数 | 事件 | 类型 | 操作符 | 常数 | Flow Control | Script Library | Categorized Library | Tutorials |
| 函数名 |
|---|
| Function: llFleeFrom( vector position, float distance, list options ); |
| 参数: vector position –在区域坐标中的位置,从那里逃跑( position in region coordinates from which to flee. )
float distance – 逃离位置的距离,以米为单位。 list options – 目前没有可用的选项。 |
| 返回值: 指示字符与区域或相邻区域中的特定位置保持特定距离。 |
| 注意事项 |
|---|
| 必须使用llCreateCharacter,否则脚本无法编译。.
逃跑的位置必须靠近导航网;否则,此行为将失败,并使用PU_FAILURE_INVALID_GOAL触发路径更新。 如果您想要像下面的示例那样避免代理或对象,那么使用llEvade将会更加优雅,并且减少sim资源的消耗。 |
| 示例 |
|---|
示例1
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 = llDetectedPos(0);
llFleeFrom(last_touched_pos, 10, []);
llSetTimerEvent(0.2);
}
timer()
{
vector last_touched_pos_now = llList2Vector(llGetObjectDetails(last_touched_key, [OBJECT_POS]), 0);
if ( llVecDist(last_touched_pos, last_touched_pos_now) > 1 )
{
last_touched_pos = last_touched_pos_now;
llFleeFrom(last_touched_pos, 10, []);
}
}
}
|
| 相关函数 |
|---|
| llCreateCharacter |
| 相关事件 |
|---|
| path_update |