Skip to content
lsl.devlsl.devLSL Dev

LlVolumeDetect

Looking for the current API? Open the llVolumeDetect reference →

Wiki description

If detect is TRUE, VolumeDetect is enabled, physical object and avatars can pass through the object.

Function notes

This works much like Phantom, but unlike Phantom, VolumeDetect objects trigger collision_start and collision_end events when interpenetrating. Collision events will trigger in any script in the object.

Specification

Events queued depending on type
VolumeDetect Phantom
Events
Supported
collision_start

collision_end
land_collision_start
land_collision
land_collision_end

Differences

There are a couple differences in how Phantom and VolumeDetect handle collisions; specifically which events are supported and how they handle the ground.
VolumeDetect
  • When physical they fall through the ground with the risk of going off-world.
  • collision events are not triggered
Phantom
  • When physical they collide with the ground but will not pass through (normal physical object behavior), land collision events are queued.

Caveats

  • It can only be applied to the root prim (which will make the entire object VolumeDetect).
  • If the volume detecting object is not physical, it can only detect physical objects and avatars. If the object is physical, it can detect its collisions with static and keyframed motion objects as well.

Attachments

Note: Attachments are not included in the avatar's bounding box. Collision events received by attachments are collisions the avatar is having with the world, not collisions the attachment is having. Nothing actually can collide with an attachmentEven if attachments were included in an avatars bounding box, you would not like the outcome, the avatars bounding box is not deformed by animations..
  • It is meaningless to enabled on attachments. Attachments cannot collide with anything.
  • Attachments do not receive collision events for avatar collisions with VolumeDetect objects.
    • Attachments do receive collision events for avatar collisions with non-VolumeDetect, non-phantom objects.

Examples

default
{
    state_entry()
    {
        llVolumeDetect(TRUE); // Starts llVolumeDetect
    }
    collision_start(integer total_number)
    {
        llSay(0, "Detected!"); // Tells you when something penetrates the prim
    }
}

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:Issues/SVC-8141

Original shared helper source (conditional wiki logic is not evaluated)
{{Issues|SVC-8141|Volume Detect objects are not always allowing objects to pass through.|type=bug}}

Template:Issues/SVC-2996

Original shared helper source (conditional wiki logic is not evaluated)
{{Issues|SVC-2996|[[llDetectedLinkNumber]] returns 0 with [[llVolumeDetect]]([[TRUE]])|type=fs}}{{#if:

{{#vardefine:caveats|*[[llDetectedLinkNumber]] will return 0 in [[collision_start]] and [[collision_end]] events of [[llVolumeDetect|VolumeDetect]] objects ([[#SVC-2996|SVC-2996]]).}}

}}

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| ({{HoverText|default|default for new objects etc}})}} {{#if:{{{td|}}}|{{{td|}}}|enables}}, {{#ifeq:{{{if|}}}|*|if|{{{if|}}}}} {{#var:FALSE}}{{#ifeq:{{#var:nbdv}}|false| ({{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| (default)}} {{#if:{{{th|}}}|{{{th|}}}|{{#if:{{{td|}}}|{{{td|}}}|enables}}}}, {{#ifeq:{{{if|}}}|*|if|{{{if|}}}}} FALSE{{#ifeq:{{#var:nbdv}}|false| (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.