Collision

From Second Life Wiki
Revision as of 13:15, 23 August 2010 by Kayaker Magic (talk | contribs) (Added caveats for more times when collisions do not work.)
Jump to navigation Jump to search

Description

Event: collision( integer num_detected ){ ; }

Triggered while task is colliding with another task.

• integer num_detected

Caveats

  • Will not detect collisions with ground; use land_collision instead.
  • Will not detect collisions between an avatar sitting on the task and the task itself (avatars are linked to objects they sit on so there is no collision, use the changed event to detect sits).
  • Phantom objects can never receive trigger collision events.
  • llVolumeDetect(TRUE) objects get trigger collision_start and collision_end but not collision() events.
  • A collision with a hovering avatar does not trigger collisions, unless the avatar turns or moves.
  • Only a physical object will get collision events from colliding with a non-physical object.


Examples

<lsl>//Will turn phantom when someone bumps into it if on the list

list access_list = ["Governor Linden"];

default {

   collision(integer num_detected)
   {
       if(~llListFindList(access_list, (list)llDetectedName(0)))
       {
           llSetStatus(STATUS_PHANTOM, TRUE);
       }
   }

}</lsl>

See Also

Deep Notes

Issues

All Issues

~ Search JIRA for related Issues
   Add enumeration to llPassCollisions() to provide PASS_ALWAYS, PASS_IF_NOT_HANDLED, and PASS_NEVER as explicit options.
(Was: Collisions passed to parent REGARDLESS llPassCollisions(FALSE) in child)

Signature

event void collision( integer num_detected );