Is there a collision event for the avatar?
|
Tip Baker
Registered User
Join date: 12 Nov 2005
Posts: 100
|
11-18-2005 00:33
Morning all,
Is it possible to tell when something has collided with an avatar?
I know a script within the colliding object can tell, but is there a collision event associated with the Avatar?
Thanks in Advance Tip
|
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
|
11-18-2005 00:38
You might try, if (llDetectedType(0) & AGENT) Good Luck :}
|
Tip Baker
Registered User
Join date: 12 Nov 2005
Posts: 100
|
11-18-2005 01:29
Cid, If I put that code in a script in an object, I would know when the object collides with any avatar. But where do I put it to run when the avatar collides with any object? Attachments only trigger when an object hits the attachment prims. How do I tell when my torso has collided with an object, eg when I've been hit by a bullet. I suppose I could check my altitude, that's usually a good indicator that you have been hit 
|
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
|
11-18-2005 03:07
Try type ACTIVE instead of AGENT.
|
Tip Baker
Registered User
Join date: 12 Nov 2005
Posts: 100
|
11-18-2005 03:49
Cid, Sorry mate I'm not making the question clear. Once the collision event is triggered, I know how to find out about the object that caused the collision. But where is that collision event? an example Suppose my avatar is standing there and someone else shoots him. Within the bullet object a collision event will be triggered when it hits the avatar and probably punt me into the sky Can I attach a script to my avatar who's collision events will be triggered by the bullet that hit me? I can detect a bullet thats coming towards me. But how do I know that it has hit me? Hope I've made it clearer. Thanks
|
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
|
11-18-2005 03:52
Any attachment will only trigger a collission event when the avatar's bounding box is penatrated. So the attachment being hit will not effect it. so llDetectedType(0) & ACTIVE will tell you that your avatar has been hit with a moving object. I hope I understand what you are trying to ask now?
|
Tip Baker
Registered User
Join date: 12 Nov 2005
Posts: 100
|
11-18-2005 03:58
Cid,
Ah! So I can just put a collision event in the HUD, for instance, and that will trigger whenever the avatars bounding box is penetrated?
I assumed that an attachment's collision events would be triggered when the attachment's bounding box was penetrated.
Thanks for your help.
|
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
|
11-18-2005 04:11
From: Tip Baker Cid,
Ah! So I can just put a collision event in the HUD, for instance, and that will trigger whenever the avatars bounding box is penetrated?
I assumed that an attachment's collision events would be triggered when the attachment's bounding box was penetrated.
Thanks for your help. I havent tried the HUD with collision events yet, but I'm assuming that it will work the same as any other attachment... maybe.
|
Tip Baker
Registered User
Join date: 12 Nov 2005
Posts: 100
|
11-18-2005 04:22
Cid,
Many thanks.
|
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
|
11-18-2005 07:11
From: Cid Jacobs I havent tried the HUD with collision events yet, but I'm assuming that it will work the same as any other attachment... maybe. Does. Verified by experiment. 
|