title: Unity | How to get multiple objects with Compound Collision Detection to work?
body: <p>I'm currently attempting to use collision detection for target selection (auto attacking). I have two objects (i.e. a player and a tower), each game object has an object hierarchy as such:</p>
  <p><a href="https://i.stack.imgur.com/q5gKY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q5gKY.png" alt="Object Hierarchy" /></a></p>
  <p>Here, the object has a:</p>
  <ul>
  <li>Target Sphere used for alerting itself, changing its game-state from idle to attack mode when another object enters this sphere.</li>
  <li>Hit Sphere which is the essential hitbox for the object to take damage/ come in contact with other objects Target Spheres.</li>
  <li>Selection Sphere which does not interact with other spheres but is the radius in which an object can be selected by the user.</li>
  </ul>
  <p>Based on this I have set each child object to have a sphere collider and set to a layer corresponding to the type of sphere it is. Below is the physics collision table currently being used. I only want the HitBox layer and Target Layers to be interacting with eachother.</p>
  <p><a href="https://i.stack.imgur.com/zQgpw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zQgpw.png" alt="Physics Collision Layers" /></a> <a href="https://i.stack.imgur.com/AY1yp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AY1yp.png" alt="Tower Sphere Layers" /></a></p>
  <p>Despite my best efforts, when running the game and having the player walk back and forth through the spheres, <code>OnTriggerEnter()</code> is never called. This method is located in the player and towers classes which are on the parent game object. Currently I have no rigidbody on either the player or the tower, but do have triggers on both of the both the player's and tower's hit spheres to trigger each others <code>OnTriggerEnter()</code>.</p>
  <p>So far I have tried:</p>
  <ul>
  <li>Adding a rigidbody to one, or both of the two parent objects</li>
  <li>Adding a rigidbody to one, or both of the child objects corresponding to the HitSphere / Target Sphere that I am testing the collision on.</li>
  <li>Switching the Layer order for the Target Sphere Layer and Hit Sphere Layers</li>
  <li>Switching the Target Spheres to have the trigger instead of the Hit Spheres.</li>
  <li>Having both Target and Hit Spheres be triggers.</li>
  <li>Manually moving the objects to collide instead of relying on the current movement system.</li>
  </ul>
  <p>Lastly, Here is an image of the two objects colliding, each within each others spheres but not calling each other's <code>OnTriggerEnter()</code>. The Cylinder outline is from the NavMeshAgent Controller which I have also tried to remove and test with but also to no avail. :(</p>
  <p><a href="https://i.stack.imgur.com/Tyead.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Tyead.png" alt="Intersection of Spheres Not Working" /></a></p>
  <p>TL;DR: Trying to do compound collision detection on multiple game objects to no avail.</p>