Hi everyone. I’m taking the unity 2D class and I have a problem with my brick breaker. When I push the ball quickly to either side of the screen during gameplay the ball suddenly becomes either really fast or really slow. I’m not sure if the issue is being caused by the bumper or by the ball. Does anyone know how to fix this?
Hi,
I don’t know in which lecture you are but did you implement Rick’s tweak to prevent boring loops? If so, make sure that the value is very close to 0f. If it’s 0.01f, set it to 0.001f.
See also:
- Forum User Guides : How to mark a topic as solved
Hi Nina,
I haven’t gotten to the part of the course where Rick talks about preventing boring loops yet, so the answer might be there. I’ll mark this issue as solved for now just in case. Thanks for your help.
If you didn’t implement his tweak, the issue might be the PhysicsMaterials. Remove them from your game. They are not needed anyway.
The only physics material that exists in the project is a bounce material on the ball, but the ball doesn’t bounce off the blocks when I remove that. Is there a way to make the ball bounce without needing a physics material?
Actually, the ball is supposed to bounce off other colliders (walls, blocks, paddle) without any physics material. If it does not, there might be a problem with the colliders. Before you look for any problems, restart Unity.
The ball does bounce off walls when I remove the bounce material, but without it, the ball slows down with each bounce until it’s suspended in midair moving very slowly. That’s what I meant to say in the last post, but I wasn’t very specific. Sorry about that.
I changed the ball’s collision detection from continuous to discrete and so far I haven’t been having any problems.
That sounds as if the problem is solved. As aforementioned, we do not need any physics material in this game because we do not use any gravity. Our ball is just supposed to collide and to bounce off in the other direction with the same speed.
See also:
- Forum User Guides : How to mark a topic as solved
Oh, I see. Thank you for helping me with this. I appreciate it.
You’re welcome.
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.