- Home /
Collider2D not working?
Hi! So i'm really new to Unity and im making my first game ever. I've struggled with this bug forever where in some specific locations the player will just pass through the floor colliders if they are falling. I found some consistent ways of making the bug happen (like in the video bellow) but it'll happen seemingly randomly aswell. If anybody could help me out that'd be great, thanks! https://drive.google.com/file/d/1-MZHdrHmR87qiJLRRVqhALkzHQKyaRXx/view
Unity Version: 2018.4.14f1 (Let me know what information you need)
Answer by BuzzyRoboYT · Feb 24 at 07:43 PM
Hi, this could be hapenning becuase your player is travelling too fast and clips through the collider. Try making your collider a bit thicker, and also check the collider on your player and make sure it isnt too thin.
Making the colliders thicker helped! Though it made some other issues pop up with some enemies lol. Still, thanks for the reply!
Answer by heinrichs81 · Feb 24 at 08:53 PM
Hi there, what you also can try: If you attached a Rigidbody2D to your GameObject (needs to attached to the same GameObject as the Collider2D is attached that should prevent your slipping trough) , then put the Body Type to Kinematic and the Collision Detection to Continuous. If you don't have attached a Rigidbody2D than feel free to do it if it does not affect your game logic. If you make your Rigidbody2D Kinematic it normaly sould not enable gravity force to your GameObject. Thats the case for 3D.
Thanks! Setting the Collision Detection to Continuos worked out for me, also smoothened how jumping feels.