Skip to content
lsl.devlsl.devLSL Dev

LlCollisionFilter

Looking for the current API? Open the llCollisionFilter reference →

Wiki description

Sets the collision filter, exclusively or inclusively.

Function notes

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

  • Any call of llCollisionFilter in the same event as llVolumeDetect changing (not just being called, but actually moving from FALSE to TRUE or vice versa) will be disregarded (before or after), if the event handler previously called a user-defined function. See
  • Damage caused by llSetDamage will still apply to a filtered avatar.
    • Consequently, the object will immediately die on collision with the avatar. (And kill the avatar their health reaches 0.)

Examples

  • Stop filtering:
llCollisionFilter("", NULL_KEY, TRUE);
  • Filter out all collisions:
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":
  • 1st instance :
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
  • 2nd instance :
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
  • 3rd instance :
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: functions

See also: events

Shared wiki helpers

The original page also injects shared parameter notes, caveats or issue information through these helpers. Their conditional MediaWiki logic is not reproduced here; inspect the preserved helper source for additional material.

Template:Issues/SVC-2490

Original shared helper source (conditional wiki logic is not evaluated)
{{Issues|SVC-2490|[[llCollisionFilter]] completely ignored after call to user-defined function and then a call to [[llVolumeDetect]]([[TRUE]])|type=bug}}

Template:LSL Function/uuid

Original shared helper source (conditional wiki logic is not evaluated)
<noinclude>{{Multi-lang|category=LSL}}</noinclude>{{LSL Injection Test}}{{#if:

{{#vardefine:p_{{{1|none}}}_desc|{{#if:{{{pd|}}}|{{{pd|}}}&#32;}}{{#if:{{{group|1}}}|{{LSLGC|Group|group}},&#32;}}{{LSLGC|Avatar|avatar}} or {{#if:{{{object|}}}|[[object]]|[[prim]]}} {{HoverLink|UUID|Universally Unique Identifier}} {{#if:{{{sim|}}}|that is in the same [[region]] {{#switch:{{{sim|}}}|*=|#default = &#32;{{{sim|}}}}}
}}}}

{{#vardefine:p_{{{1|none}}}_hover|{{#if:{{{ph|}}}|{{{ph|}}}&#32;|{{#if:{{{pd|}}}|{{{pd|}}}&#32;}}}}{{#if:{{{group|1}}}|group,&#32;}}avatar or {{#if:{{{object|}}}|object|prim}} UUID {{#if:{{{sim|}}}|that is in the same region {{#switch:{{{sim|}}}|*=|#default = &#32;{{{sim|}}}}}
}}}}

<includeonly>
{{#ifeq:{{#var:article-type}}|event||{{#if:{{#pos:{{#var:moded}}|r}}{{#pos:{{#var:moded}}|u}}||{{#vardefine:hidden-text|{{#var:hidden-text}}
{{LSLC|Avatar/As A Parameter}}
}}}}}}
</includeonly>

}}<noinclude>
{| {{Prettytable}}
|-{{Hl2}}
!var
!value
|-
|desc
|{{#var:p_{{{1|none}}}_desc}}
|-
|hover
|{{#var:p_{{{1|none}}}_hover}}
|}
</noinclude>

Template:LSL Function/boolean

Original shared helper source (conditional wiki logic is not evaluated)
{{LSL Injection Test}}{{#if:

{{#vardefine:nbdv|{{#switch:{{uc:{{{default|}}}}}|T|TRUE=true|F|FALSE=false}}}}

{{#vardefine:p_{{{1|}}}_desc|{{#if:{{{bool|}}}|{{HoverLink|boolean{{#var:lang}}|A type that can only be true or false|boolean}},}} {{{pd|}}} {{#if:{{{bool|}}}{{{pd|}}}|{{#ifeq:{{{if|}}}|*|if|{{{if|}}}}}|{{ucfirst:{{#ifeq:{{{if|}}}|*|if|{{{if|}}}}}}}}} {{#vardefineecho:TRUE|{{LSL Const{{#var:lang}}|TRUE|integer|1}}}}{{#vardefine:FALSE|{{LSL Const{{#var:lang}}|FALSE|integer|0}}}}{{#if:{{{non-zero|}}}|{{Footnote|handle=non-zero|Any value that is not zero/{{#var:FALSE}} is treated the same as {{#var:TRUE}}. This behavior should not be depended upon.|Any value that is not zero/FALSE is treated the same as TRUE. This behavior should not be depended upon.}}}}{{#ifeq:{{#var:nbdv}}|true|&#32;({{HoverText|default|default for new objects etc}})}} {{#if:{{{td|}}}|{{{td|}}}|enables}}, {{#ifeq:{{{if|}}}|*|if|{{{if|}}}}} {{#var:FALSE}}{{#ifeq:{{#var:nbdv}}|false|&#32;({{HoverText|default|default for new objects etc}})}} {{#if:{{{fd|}}}|{{{fd|}}}|disables}}}}

{{#vardefine:p_{{{1|}}}_hover|{{#if:{{{bool|}}}|boolean,}} {{#if:{{{ph|}}}|{{{ph|}}}|{{{pd|}}}}} {{#if:{{{bool|}}}{{{pd|}}}{{{ph|}}}|{{#ifeq:{{{if|}}}|*|if|{{{if|}}}}}|{{ucfirst:{{#ifeq:{{{if|}}}|*|if|{{{if|}}}}}}}}} TRUE{{#ifeq:{{#var:nbdv}}|true|&#32;(default)}} {{#if:{{{th|}}}|{{{th|}}}|{{#if:{{{td|}}}|{{{td|}}}|enables}}}}, {{#ifeq:{{{if|}}}|*|if|{{{if|}}}}} FALSE{{#ifeq:{{#var:nbdv}}|false|&#32;(default)}} {{#if:{{{fh|}}}|{{{fh|}}}|{{#if:{{{fd|}}}|{{{fd|}}}|disables}}}}}}

}}<noinclude>
{| {{Prettytable}}
|+<code><nowiki>{{{{FULLPAGENAME}}|bool|bool=*|pd=1|ph=2|default=false}}</nowiki></code>{{{{FULLPAGENAME}}|bool|bool=*|pd=1|ph=2|default=false}}
|-{{Hl2}}
! #var
! value
|-
{{VarPair|p_bool_desc}}
|-
{{VarPair|p_bool_hover}}
|-
{{Footnotes}}
|}
{| {{Prettytable}}
|+<code><nowiki>{{{{FULLPAGENAME}}|bool|bool=*|pd=1|ph=2|td=3|th=4|fd=5|fh=6}}</nowiki></code>{{{{FULLPAGENAME}}|bool|bool=*|pd=1|ph=2|td=3|th=4|fd=5|fh=6}}
|-{{Hl2}}
! #var
! value
|-
{{VarPair|p_bool_desc}}
|-
{{VarPair|p_bool_hover}}
|-
{{Footnotes}}
|}
{| {{Prettytable}}
|+<code><nowiki>{{{{FULLPAGENAME}}|bool|bool=*|if=*|non-zero=*|pd=1|ph=2|td=3|th=4|fd=5|fh=6}}</nowiki></code>{{{{FULLPAGENAME}}|bool|bool=*|if=*|non-zero=*|pd=1|ph=2|td=3|th=4|fd=5|fh=6}}
|-{{Hl2}}
! #var
! value
|-
{{VarPair|p_bool_desc}}
|-
{{VarPair|p_bool_hover}}
|-
{{Footnotes}}
|}
{| {{Prettytable}}
|+<code><nowiki>{{{{FULLPAGENAME}}|bool|if=when|non-zero=*|td=3|th=4|fd=5|fh=6}}</nowiki></code>{{{{FULLPAGENAME}}|bool|if=when|non-zero=*|td=3|th=4|fd=5|fh=6}}
|-{{Hl2}}
! #var
! value
|-
{{VarPair|p_bool_desc}}
|-
{{VarPair|p_bool_hover}}
|-
{{Footnotes}}
|}
</noinclude>
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.