Unofficial LSL Reference

[[functions:llpasscollisions]]


Unofficial LSL reference

User Tools

Login

You are currently not logged in! Enter your authentication credentials below to log in. You need to have cookies enabled to log in.

Login

Forgotten your password? Get a new one: Set new password

This is an old revision of the document!


Function: llPassCollisions

llPassCollisions(integer pass)

Indicates whether a child prim in a linkset should let the root know that it has registered a collision, when there is at least one script in the same child prim that has one of the collision events (collision_start, collision, collision_end, land_collision_start, land_collision or land_collision_end).

When a script in the root prim has a collision event, collisions in the whole object are registered by the root in principle. However, when a child prim has at least one script that has a collision event and that prim is collided, by default only that prim will register the collision, and the root will not register it. This function allows changing that default, so that both the root and the child can register the collisions.

It may be useful e.g. when the script in the root needs to detect whether the object was impacted, no matter where, but one specific prim needs to perform an additional action when it is impacted.

Parameters

pass

A boolean value indicating whether to pass collisions to the root.

Notes

  • For an object with set to TRUE, this setting has no effect. Only the root will register collision_start and collision_end events, no other prim will, and no prim will register collision or land_* events.
  • The setting only takes place for the prim where the script is in; it doesn't affect any other prims.
  • This setting is NOT a prim property, it is per script. Deleting or stopping all scripts that changed it from default will cause the effect to cease, and the behaviour to revert to default.

Short examples

llPassCollisions(TRUE); // Enables collision passing for this prim.

llPassCollisions(FALSE); // Disables collision passing.

Complete examples

When this simple script is dropped into a child prim that has more scripts, one of them with a collision event, it will let the root know that it has been impacted even if the impact only affects the prim the script is in. If it is removed, and only this prim is impacted, the root will not register the impact.

llPassCollisionss-example.lsl
default
{
    state_entry()
    {
        llPassCollisions(TRUE);
    }
}

See also