Skip to content
lsl.devlsl.devLSL Dev

Collision start

Looking for the current API? Open the collision_start reference →

Wiki description

Triggered when task starts colliding with another task

Caveats

  • Will not detect collisions with ground. Use land_collision_start instead.
  • 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

default
{
    collision_start(integer num)
    {
        llSay(0,"No pushing.");
    }
}
list DetectedAvatars = [];
default
{
    state_entry()
    {
        llVolumeDetect(TRUE); // Enable detection of people colliding with object....
    }
    collision_start(integer detected)
    {
        integer index = llListFindList(DetectedAvatars, [llDetectedKey(0)]);
        if (index == -1)
        {
            llInstantMessage(llDetectedKey(0), " Welcome to the Community");
            DetectedAvatars = llListInsertList(DetectedAvatars, [llDetectedKey(0)], -1);

            if (llGetListLength(DetectedAvatars) == 2)
            {
                DetectedAvatars = llDeleteSubList(DetectedAvatars, 1, 2);
            }
        }
    }
}

See also: functions

See also: events

Known issues

Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.