- Home /
Collider IsTrigger won't work correctly with close second Collider
Hello, I'm currently trying to create an Gameobject with two Colliders, a Trigger Collider(Box) and a Physics Collider(Mesh).
The trigger Collider only covers the top of my object, while the Physic Collider covers the whole Gameobject.
When my Character lands on the top of the Gameobject, it has to bounce into the air. And not bounce into the air when it touches the side of the Gameobject.
This only works correctly when the Colliders are far apart. I want them to be almost directly above each other.(See Image)
When the character jumps on top of the Gameobject, the Debug Log shows that the Trigger is triggered but no bouncing happens...
Player code when on Gameobject:
Thank you in advance
If you are seeing the Debug log, then yes you're trigger is working. In that case, you should be showing what player$$anonymous$$oveDirection does exactly, because it seems like this is not be executed the way it should.
Hi Jonathan,
Yes, the Trigger works as it shows the Debug Log and plays the Jump animation.
$$anonymous$$aybe it doesn't work correctly because the Physic collider below the Trigger collider stops the upward movement and therefore disables the upward movement command of the trigger collider.
Is there a way to get around this?
I have tried it with separate Gameobjects, but it doesn't help.
Hi BlueLED,
Yes, it works if I disable the $$anonymous$$esh Collider.
It also works if I set the $$anonymous$$esh Collider to Trigger and disable the Box Collider.
Your answer
Follow this Question
Related Questions
Is there a way to determine if an object is within a trigger, from objects perspective? 2 Answers
Physics Possibilities?: Angles, Penetration, Exceptions 4 Answers
Collission and Trigger on Same object 0 Answers
Get All Renderers inside of GameObejct 0 Answers
Is it possible to combine child trigger of a object to only trigger OnTriggerEnter once? 1 Answer