Can you count how many colliders are within a collide?
For example in this images, each object would have a script that counts the number of colliders it is colliding with. How would you do that with more than one collision?
Can you count how many colliders are within a collide?
For example in this images, each object would have a script that counts the number of colliders it is colliding with. How would you do that with more than one collision?
just use a global variable. Add one on triggerenter, and subtract one on trigger exit.
But if the TriggerEnter is already enabled, is it still able to calculate another while it in the process?
I would of thought so if you attached the scripts to the object.
Something like to the object. Then somewhere else you need a global var to keep count.
function OnTriggerEnter (col : Collider) {
//update global var in another script +1
}
function OnTriggerExit (col : Collider) {
//update global var in another script -1
}
function Update () {
}