OnTrigger events on multiple objects

I’m having trouble getting an OnTrigger event to work with multiple collisions, whether it be another player or object also in the trigger.
Here’s my code, I’ve tried putting it on the trigger and on each player, but it only affects one object:

void OnTriggerStay(Collider other1){
	if(timer > 0)
		timer -= Time.deltaTime;
	if(timer <= 0){
		ApplyDamage(-1);
		timer = cooldown;
	}
}

This is only the function, not all of the variables are included. Everything else works, but the trigger is only working for one object.

1 Answer

1

Make sure your collisions have each at least one non-kinematic rigidbody involved.