Avoid llDetectedType & passing collisions

Creating scripts
Post Reply
User avatar
Mike Lorrey
Posts: 361
Joined: Sun Sep 04, 2016 5:40 pm
Has thanked: 71 times
Been thanked: 269 times

Avoid llDetectedType & passing collisions

Post by Mike Lorrey »

I have found that llDetectedType(0);, when used to detect an AGENT, does not work in a collision_start event to use an if/else logic tree to delineate responses based on the type of thing colliding with the scripted object.

A second problem is in passing collisions from child prims to roots. While touch_start events detect touches with child prims just fine, collision_start events do not detect collisions with child prims UNLESS you put an additional script in each child prim you want to detect collisions from, that simply sets llPassCollisions(TRUE);

While this is inefficient, requiring more scripts and therefore using up more processor time, than allowing you to detect collisions by link number (yes, that also doesn't quite work well in collision_start events, only some of the time, at least with an ODE physics engine.

The workaround suggested to me by Kayaker Magic was to instead use llGetAgentSize() in a collision_start event, since if its not an agent colliding with it, the function will return a null vector. This still requires you to use a llPassCollisions(TRUE); statement in scripts in any child links you want to detect collisions from.
Post Reply