Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Collision in Children

Adam Ramona
Registered User
Join date: 5 Jan 2005
Posts: 56
07-30-2007 07:33
It seems that collisions with a child in a linkset will only be registered if phantom is false. Here's my empirical test: a prim, not phantom, has this code in it:
CODE

collision_start(integer boink)
{
llOwnerSay("collision");
}


Works fine. Prim is made child of linkset. Still works fine. Then, either the child or the parent is made phantom (through the editor or llSetPrimitiveParams), it doesn't work anymore, even if llVolumeDetect is set to true. Therefore, it appears that setting a prim to phantom, or its parent, in a linkset will stop collisions from being registered with that child prim. Why, oh why must this be so?

ps. What is the tag to format code nicely in a forum post?
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
07-30-2007 08:59
Trying to guess the confusion here, one thing to note from the wiki ():
From: someone
The script must be applied to the root object of the link set to get the collision events.
also
From: someone
As of SL 1.6.7, llDetectedLinkNumber will only ever return 0 when used with llVolumeDetect, even when used in a multi-prim object.
so you can't tell which prim in the linkset got the collision. But collision with a child prim in an llVolumeDetect(TRUE) linkset does generate a collision event detectable in the root, if that helps.
Adam Ramona
Registered User
Join date: 5 Jan 2005
Posts: 56
07-30-2007 15:56
Thanks Qie, that helps clarify for me. I'm trying to have a child prim play a sound when it gets a collision. My fix is to have the parent send a link message to the child, which then plays the sound. The downside is, it seems impossible to prevent the child from playing the sound when the parent is collided with, since 0 is always returned in llGetLinkNumber when llVolumeDetect is true.
Yumi Murakami
DoIt!AttachTheEarOfACat!
Join date: 27 Sep 2005
Posts: 6,860
07-30-2007 21:11
One of the aspects of SL I dislike the most is that either every prim in an object must be phantom, or none.