Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Collision event on linkset

Ansariel Hiller
Registered User
Join date: 24 Nov 2008
Posts: 83
10-13-2009 13:48
Hi there!

I've got a little problem with the collision_start event of a linked set of prims. Basically, I want to detect with which prim a collision occured, but when I put a script like the following example in each prim, the event is fired for all prims.

default
{
on_rez(integer param)
{
llPassCollisions(FALSE);
}

collision_start(integer num)
{
llOwnerSay(llKey2Name(llDetectedOwner(0)) + ": 1 point";);
}
}

So if I have let's say 5 prims in the link set, I get 5 times the message. Any idea how I can get it working in a way I only get the message once from the prim that was actually hit?

Thanks for your help!
Ansa
Jack Abraham
Lantern By Day
Join date: 11 Apr 2008
Posts: 113
10-13-2009 13:59
Ansariel, is there a reason not to do this with one script in the root and use llDetectedLinkNumber(integer number) to get the touched prim?
Ansariel Hiller
Registered User
Join date: 24 Nov 2008
Posts: 83
10-13-2009 14:19
Uhem yes: I didn't know that method existed until you told me. I tested it and it works perfect! Thanks for your help! :)