Sets the collision filter, exclusively or inclusively.

Syntax

void llCollisionFilter( string name, key id, integer accept );

Forced delay: 0.0 seconds. Energy: 10.0.

Parameters

string name
filter for specific object name or avatar legacy name
key id
filter by group, avatar or object UUID
integer accept (boolean)
TRUE only process collisions that match, FALSE instead excludes matches

If accept == TRUE, only accept collisions with objects name AND id (either is optional), otherwise with objects not name AND id
If name or id are blank they are not used to filter incoming messages (or you could say they match everything). If id is an invalid key or a null key, it is considered blank.

Caveats

Examples

llCollisionFilter("", NULL_KEY, TRUE);

llCollisionFilter("", NULL_KEY, FALSE);

This script, placed in a wearable object, detects a collision when the person wearing it collides with an object named "Post":

an object named "Post" has several child prims named "Object" . The prim named "Post" hits the scripted object or scripted prim , the collision will be detected

an object named "Post" has several child prims named "Object" . A child prim named "Object" hits the scripted object or scripted prim, the collision will be detected

an object named "Object" has several child prims named "Post" . A prim named "Post" hits the scripted object or scripted prim, the collision will not be detected

default
{
    state_entry()
    {
        llCollisionFilter("Post","",TRUE);
    }

    collision_start(integer total_number)
    {
        llSay(0, "OUCH!");
    }
}

See also

Events

Functions

Deep notes

Issues