- Home /
2D Border doesnt allow the nutbomb gameobject to bounce
I am a beginner at this stage. I was working on a breakout game following the tutorial provided by Unity itself. I made the Border 2D with a box collider (does it need a rigidbody 2d? because when i did that and ticked the Is Kinematic and on the collider i ticked IsTrigger).
Does it need a line of code or something for it?
I also made a bouncy Physics2D Material and set the friction to 0 and bounciness to 1 but it still is not working. I've been trying different things to make it work but nothing.
Thank you so much for your help :)
PS: I am using C#
Answer by hexagonius · May 31, 2015 at 01:03 PM
If the border never moves, it does not need a Rigidbody2D. If you want something to bounce off of it, have both Objects' isTrigger option false. You need to assign the Physics Material 2D to the Collider2D-Component of the ball.
For physics simulation to work you don't need any code, only if you're going to intervene in some way.
Always make sure all the Objects' Colliders are 2D-Colliders.
I did all of the stuff you said but it is still not bouncing. I even checked the positioning of the Z axis maybe it was far away from the nut....but it's all good. I dont know why it is doing this exactly :(