- Home /
The character cannot pass through the trigger
Hello everyone. I was faced with the problem of entering the trigger. There is a Collider activated as a trigger. In the script, I described the event:
void OnTriggerStay(Collider other) { if (other.CompareTag("Player") && !isShow) { //somecode } }
When I try to enter the right trigger - the character does not pass through it, if there is a Collider. But when I try to jump into it - everything works. Also, if I try to log into the trigger sideways it works. What could be the problem?
What kind of collider are you using for the trigger? What you describe isn't be possible, so it's most likely some mistake like some other collider overlapping this area, or some piece of code changing the isTrigger toggle, or some other misunderstanding about the physics system.
Answer by daviddickball · Apr 24, 2015 at 10:05 AM
You might be using a mesh collider for the trigger. Use a cube collider if this is only a trigger.
Answer by Fappp · Apr 24, 2015 at 10:16 AM
add a debug.log to the onTriggerEnter, this tells you what is hit when and what obstructs your player.
Debug.Log( "Hit this one: " + other.gameObject.name );
Answer by progmeer · Jun 06, 2015 at 10:19 PM
If your object is a mesh collider, try setting the "is convex" check to true. That solved my issue.
Your answer
Follow this Question
Related Questions
Can't click gameobject when over another trigger? 1 Answer
Trigger-based vehicle ai? 1 Answer
Trigger Spawning? 1 Answer
Temporarily ignore collisions between player and enemies 2 Answers
Adding Sound To Collectable Object 1 Answer