OnTriggerStay not detecting compound colliders?
Seriously, I can't believe after all this time I still have issues with simple stuff like this.
I have an empty gameobject with a rigidbody, and a tag, and it has a child gameobject (or more) with a box collider.
I have another gameobject with the OnTriggerStay script, who's suppose to find the tagged object, but its detecting the cube only, of the first gameobject, not the first object's parent with the rigidbody. In other words the compound colliders aren't working. When I don't have the tag check, Its detecting the collider objects themselves instead of the parent with rigidbody.
Does compound apply only to colliders, and the triggers are too dumb to tell if a gameobject is made of compound colliders, or is something wrong with my Unity version? If its the prior, I should instead search by tag recursively, right? Starting from child going up till it hits the tag.
I'm using v5.0.1 because I'm making this for an asset, but I also tested it in 5.4 beta, and its the same.
To sumarize hierarchy:
1.RigidbodyGO (with tag)
1a. =>ChildColliderGO
2.OnTriggerStayGO (trying to detect the tagged GO, but only picks up the child with the collider if I remove the if(other.collider.gameobject.tag == "whatever") conditional, and with the conditional it never detects the parent, same goes for OnTriggerEnter)
Anyone? Didn't find an answer yet. I ended up going with upwards recursive search to get the tagged object.
Your answer
Follow this Question
Related Questions
How to allow only one object in a trigger at a time? 2 Answers
Nothing is happening with these scripts, why? 0 Answers
How to check for a player tag OnTriggerEnter 1 Answer
Check if other.object changes his tag (OnTriggerStay2D) 0 Answers
Issues trying to activate an image through OnTriggerEnter/Exit/Stay(Flickering) 1 Answer