- Home /
Compound and Composite Colliders and Enter/Exit Detection
Alrighty if someone here could explain me the mystieries of what is Compound and what is Composite collider I would be very grateful.
My thoughts so far are following: Compound collider is when you add multiple colliders onto your children then parent treates them as single collider. Composite collider is when you have more colliders on same object positioning differently.
I've tried using both methods and always end up with same problem whether I'm using OnTrigger or OnCollision set of methods.
Example is following: If I have two box colliders that are intercolliding with each other in order to make some shape let's say pillar: first one scaled like bottom of the pillar (collider A) and other as pillar itself (collider B) and they are intersected and should act as single one (A+B = C).
Both OnCollisionEnter and OnTriggerEnter fire whenver object enters any of these colliders (A or B) and same happens with Exit methods. So the problem is following I want to change for example color of the pillar into red when I enter and return it to normal when i exit the pillar. If I exit from pillar collider B into the base of pillar collider A then the methods of exit and enter fire and the color will be changed then, which is far from the thing that the two colliders should act as one and i can wonder around in them and have exit fired only when i exit the collider (composited/compuned one aka C)
If anyway has any solution to this I will be most gratefull.
Thank you in advance
Your answer