- Home /
No collisons on the side wall on break out game
Hello, i have just started using unity few days before and for some practice i started following the Beginners Break-Out game tutorial from this site, but the problem is after scripting on the ball, my ball is not bouncing back from the wall, i'm copying the exact tutorial and the code is same but it's not working with me while it runs perfectly on the video " https://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/creating-a-breakout-game?playlist=17219 "
Any help will be predicated, thanks !
Answer by njelly · Oct 05, 2015 at 07:47 PM
As I understand your problem, the ball simply passes through the wall instead of bouncing off it, correct? Some things you might want to check for:
In the colliders for your wall objects, is the "Is Trigger" box checked? Setting colliders to be triggers removes any collision.
If two objects collide and the RigidBody components for both are set to "Is Kinematic," they will simply pass through each other instead of bouncing. Setting objects to be kinematic removes them from most physics calculations, and it's possible both your ball and wall are set to be kinematic.
If you are calling the "OnCollisionEnter" function, make sure everything is capitalized correctly! I was recently very frustrated only to find out that I had mistakenly typed "onCollisionEnter." Doh!
Make sure your colliders and rigidbodies are enabled in the first place. If they're disabled in the inspector, obviously they won't be doing anything in your game.
EDIT: Also make sure you're using all 2D colliders and rigidbodies or all 3D colliders and rigidbodies. A 2D collider will not collide with a 3D collider and vice versa.
Hope this helps!
Double checked all of this and every thing seems ok, still it's not working !! I really got stuck here :|
One more thing to check for: it is not possible for a 2D collision object to collide with a 3D collision object. If you've mixed up 3D colliders and rigidbodies with 2D colliders and rigid bodies, that might be the source of your problem. You need to have either all 3D colliders or all 2D colliders.
3D colliders are called things like "BoxCollider" while 2D colliders are specifically marked "BoxCollider2D." Same with Rigidbody and Rigidbody2D.
Your answer
![](https://koobas.hobune.stream/wayback/20220612040134im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Character wont slide 0 Answers
Moving cube on x by 1 1 Answer
getting udp package info inside unity (GlovePIE) 0 Answers
Are there any complete 2D survival game Unity tutorials? 2 Answers
what should i learn addressables or asset bundles ?? 0 Answers