Hi everyone,
I’m currently working on an RTS Game. All movable objects have a rigidbody and several trigger colliders to detect other objects or for example check whether an object is in range or not. I use gameobjects with different layers for each type of object (units, animals, zombies, vehicles, static objects, etc.) and each type of trigger detection I need for that object type (touch trigger, near trigger, in sight trigger, etc.) so I can set the collision matrix to only detect collisions when needed and this way hopefully enhance performance. But since there are only 32 layers available and there are a lot of different objects that need different trigger colliders in my propject, I’ll soon run out of layers, since I need them for other things as well. So my question is, how expensive is trigger collision? Does it make sense to avoid unnecessary collisions with different layers and the collision matrix in my case? Or should I let the trigger collisions be detected and analyze them with different tags or IDs to check what kind of trigger and what kind of parent object collided? And how well would this perform in comparison? Does it even make a difference?
Thanks in advance