Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Multiple colliders with separately attached scripts on separate objects all getting the same calls?

Discussion in 'Physics' started by douglasg14b, Mar 30, 2015.

  1. douglasg14b

    douglasg14b

    Joined:
    Oct 2, 2014
    Posts:
    34
    Edit: Please Ingore, there was a 2nd invisible object causing it to trigger twice. I've figured it out

    I have two spherical colliders attached to two children my unit, each represent a "range" for attacking. Each of the two child objects have a script with the OnTrigger methods and their own collider.

    Issue is when an object enters the edge of the outer collider (AttackBoundary) both the Trigger method in the point defense object's script and the script in the attack boundary object are called. The Battelship object has the rigidbody.

    How do I get each object's collider to only call the Trigger method within itself, and not other objects?



     
    Last edited: Mar 30, 2015