- Home /
Ball falling through trigger floor
I'm trying to make a ball rolling game. I've added the Rigidbody component to the ball and everything is fine until I enter the trigger part of the ball then the ball goes through the floor like a ghost. I need the floor to trigger a GUI but obviously I can't do it when the ball goes through the floor. Any solutions or suggestions? I am using Unity 2018.1.f1.
Answer by crawniik · Jun 16, 2018 at 01:46 AM
turn off the Is Trigger and use OnCollisionEnter.
that may help
let me know
Hi crawniik, I tried your suggestion and I got mixed results. By disabling the IsTrigger checkbox, I managed to stop the ball from going through the floor. However, in doing so I cannot get the textbox to appear. So I tried simply duplicating the trigger part of the floor so that one instance of the floor has the IsTrigger checkbox checked and the other does not and as a result I was able to get the text to appear without the ball going through the floor. Thank you immensely for your help. I gratefully appreciate it.
Did you try replacing the OnTriggerEnter code with OnCollisionEnter?
Answer by DarkToadster · Jun 17, 2018 at 04:46 AM
You could just add a Child to your Floor, which has the Trigger Collider and the Script.
Your answer
Follow this Question
Related Questions
OnTriggerEnter Inconsistant 0 Answers
Trigger Rigidbody with CharacterController 0 Answers
Moving Trigger/Platform and Moving Player calls OnTriggerEnter every frame 0 Answers
Unity 2D Trigger Detection is not working. 6 Answers
OnTriggerEnter not being called, have trigger, RB, and colliders set? 1 Answer