Jump to content

How Can I Detect Collision with Specific Child Prim?


Syle Devin
 Share

You are about to reply to a thread that has been inactive for 3364 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I am making a skeeball game. I have skeeballs that I want to die when they hit a "score" prim within the link group of the skeeball lane. I know you can have the link group detect which child prim has been hit but can you have a single object detect the child prim that it hit? 

I'm sure I could use messages between the ball and the skeeball but there may be multiple balls rolling around and I only want the one that has collided to die. Otherwise the other balls would die before the appropriate time and points may not be counted. 

I'm open to alternatives as long the alternative allows me to only have 1 ball be deleted at a time. 

 

Thank you!

 

Edit: I have tried using llCollisionFilter(); but I have not had any luck, it doesn't seem to work for child prims.

 

Link to comment
Share on other sites

 in your root object, get the name of the link that was hit

and send a message to the skeeball if it was a "score" prim

 

 collision_start(integer num)
    {    
        if(  llGetLinkName(llDetectedLinkNumber(0)) == "score")
        {
           key id = llDetectedKey(0);   // the key of the skeeball that hit it
           llRegionSayTo(id, 0, "die");  // send a message to that skeeball ONLY   
        }
    }

 

in your skeeball , put a listen

 

 listen(integer channel, string name, key id, string message)
    {
      if(message == "die"
      { llDie();
      }
    }

 

this should send a message Only to the skeeball that did the hitting, use

a different channel than zero for your listen and regionsay  :)

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3364 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...