Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Collision object recognition

Corporal Candour
Registered User
Join date: 3 Sep 2005
Posts: 38
03-23-2006 12:40
Is there any way that an object can recognize a specific object it's colliding with, say, by the other object's name and then perform a specific action if it has collided with that object?

Ok, so here's an example:

Object A collides with a normal object - nothing happens
Object A collides with a specific object...one named 'john', for example - an event happens

However, I'd like it also to recognize the creator of the specific object, so the event won't happen with just any object named 'john', just the object 'john' that was created by me.
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
03-23-2006 12:54
You can use llDetectedName to find the name of the object you collided with, as long as you call llDetectedName while processing the collision event (i.e. not on a timer later, or a listen, or something).

I don't think there's a direct way to find out who created a detected object.
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
03-23-2006 13:00
If the owner is in the same sim, you can use llKey2Name(llGetOwnerKey(llDetectedKey(n))) to get their name. If they're not, though, you'll have to know their key and use llGetOwnerKey(llDetectedKey(n))... which should be okay if it's just you you want to filter for.