Difference between revisions of "LlCollisionFilter"

From Second Life Wiki
Jump to navigation Jump to search
m (changed OR to AND in describing the behavior of accept = FALSE. it ignore an object if name AND key match. it's not either or (what is said previously))
Line 17: Line 17:
Filter out all collisions:
Filter out all collisions:
<lsl>llCollisionFilter("", NULL_KEY, FALSE);</lsl>
<lsl>llCollisionFilter("", NULL_KEY, FALSE);</lsl>
This script, placed in a wearable object, detects a collision when the person wearing it collides with an object named "Post":
<lsl>default
{
    state_entry()
    {
        llCollisionFilter("Post","",TRUE);
    }
    collision_start(integer total_number)
    {
        llSay(0, "OUCH!");
    }
}</lsl>
|helpers
|helpers
|also_functions=
|also_functions=

Revision as of 16:00, 3 June 2010

Summary

Function: llCollisionFilter( string name, key id, integer accept );

Sets the collision filter, exclusively or inclusively.

• string name
• key id
• integer accept

if accept == TRUE, only accept collisions with objects name AND id (either is optional), otherwise with objects not name AND id

Examples

Stop filtering: <lsl>llCollisionFilter("", NULL_KEY, TRUE);</lsl> Filter out all collisions: <lsl>llCollisionFilter("", NULL_KEY, FALSE);</lsl> This script, placed in a wearable object, detects a collision when the person wearing it collides with an object named "Post": <lsl>default {

   state_entry()
   {
       llCollisionFilter("Post","",TRUE);
   }
   collision_start(integer total_number)
   {
       llSay(0, "OUCH!");
   }
}</lsl>

See Also

Events

•  collision_start
•  collision
•  collision_end

Functions

•  llPassCollisions
•  llVolumeDetect

Deep Notes

Search JIRA for related Issues

Signature

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