- Home /
Detect more than one collider trigger
Hi there,
I'm having a problem with a multiple colliders triggering one event. I created a sphere collider, it's attached to the player which has its own collider. The reason I'm using on trigger is to nullify the effect of having 2 colliders which causes the character to fly (Y-axis up). It solved that problem, but now I can't detect if it is colliding with an enemy's collider. The OnTriggerEnter only detects it with it's own collider doesn't trigger any more, even it attacking an enemy. Please help. Thanks!
Sohaib
Answer by ScroodgeM · Jul 31, 2012 at 09:06 PM
best way to use separately child object with single collider for each additive collider you need on a single model.
Answer by Sohaib08 · Aug 03, 2012 at 04:55 PM
Yeah, I tried that but the it wouldn't stop triggering itself and if I used the Physics.IgnoreCollisions of the root, it wouldn't trigger period. I found out the best way was to actually determine the distance between the weapon and the target and when it's within reasonable bounds and the character is in combat, it triggers. Thanks though,
using triggers for such long distance is not the best way. this trigger will check everything that is in collision zone at this will decrease performance. for thing like distance better to calculate it. in performance reason compare squared distance to detect if some thing in range.