StarSong Bright
SL Addict
Join date: 24 Jan 2007
Posts: 191
|
11-14-2009 04:12
Hi All,
I am trying to figure out what code i need if i want to have two avatars, each wearing an opposite hud (ie hunter and hunted) that is able to detect when two individuals wearing opposing huds collide. Can someone point me on the right path? Thanks!
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
11-14-2009 09:19
You can use collision_start in an attachment (including a HUD). No special setup is required, it will report back on collisions with the avatar and not the attachment itself.
You may want to use llMinEventDelay to space out collision events a bit; avatars tend to collide with stuff all the time, and you could find yourself with a laggy script otherwise. If you are looking for collisions from a specific avatar or object, look into llCollisionFilter.
Once you get the collision, you can use chat stuff (llSay etc. on one end, llListen on the other) to send "well hi there!" messages between the HUDs, so you can confirm that you collided with someone who is wearing one. llGetOwnerKey might be useful here if there will be multiple HUD wearers in the area.
|