LlFleeFrom

De DigiWiki.

vector last_touched_pos;
key last_touched_key;
 
default
{
	state_entry()
	{
 
	}
 
	touch_start(integer total_number)
	{
		last_touched_key = llDetectedKey(0);
		last_touched_pos = llList2Vector(llGetObjectDetails(last_touched_key, [OBJECT_POS]), 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(owner_pos, last_owner_pos) > 1 )
		{
			last_touched_pos = last_touched_pos_now;
			llFleeFrom(last_touched_pos, 10, []);
		}
	}
}

Note

The position vector can be set outside the current region by using extended range region coordinates: e.g., to avoid the SE corner of the region to the East of the current one, you could llFleeFrom(<0.0, 512.0, 0.0>, []);

Also

Events

Outils personnels
  • Cette page a été consultée 1 024 fois.
donate
Google Ads