Bounciness Setting / Results not matching Lecture

I am using Unity 4.6.9f1, and I can set the bounciness of my Physics2D Material to well above 100, which did not match the Lecture. Also, at a Bounciness of 1, the ball actually very slowly bounces higher and higher; the increase is almost undetectable. Have you heard of this, before? Is there a setting or box that I may have checked to make this behaviour happen? The Mass and Gravity Scale of my Game Object are both set to 1. Confused, though my results are somewhat similar to the Lecture, they are also not the same.

Thank you.

7 Likes

Same Unity version and same behavior as you. At 1 bounciness the ball seems to slowly gain altitude at every bounce. Any help is appreciated! :slight_smile:

Hi Trevor,

I’ve experienced this problem in Java before and I think it stems from rounding errors on floating point calculations. A bit of google digging shows that this is somewhat of a known problem in Unity and with no proper ‘physics’ fix available.

The best solution seems to set bounciness at 0.98 which although a hack, does fix what you’re seeing.

6 Likes

Hi AngryFarmer,

Yes, this seems to work, I found this POST related to this problem and he set the bouncing value to 0.9805824, which pretty much is a perfect bouncing.

8 Likes

AngryFarmer & David,

Sincere thanks for your research. I will try the work-around, this weekend.

Oh - you all are great. I noticed the exact same thing - in the same version of Unity. I tried playing around with the bounciness, but had no real idea what was causing the physics miscalculation. I rewatched the lectures - to no avail. I was about ready to hop onto Google, but I decided to check the forum here - and BOOM - you all already had it solved and explained. That is awesome. Thanks.

3 Likes

Hi guys,

Just a quick update regarding this hack. As you complete the game, you’ll notice that setting the bounciness below 1 actually makes the game slow down as you keep breaking blocks and instead of getting faster and more difficult it all gets slower and a bit of a drag. The way to change this and create the rising difficulty is actually to increase the bounciness over 1 so that you effectively add energy at every bounce. I found a value of 1.005 to be quite adequate.

Hope that helps!

2 Likes

Thanks AngryFarmer,

I am surprised the course instructors have not commented on this issue, yet, as Ben has another course devoted to Physics.

Thanks for the input, and we’ll all have to watch our games, as we play them, to make sure things are behaving as expected.

The default unity5 gravity setting is .981 - so this is why you need a bounce value of .981 to maintain equilibrium.

2 Likes

I know this has been (solved) a couple of months ago. I came here after getting the same “glitch” (kept bouncing higher) and your hack did work. Then I returned to the video and Ben has updated it and recommended setting the collision detection to “continuous” - which also does fix the issue :slight_smile: . Just bear in mind its about a minute after he initially tells you to set the bounciness to 1.

4 Likes

I also have this problem, but decided maybe I will let it continue to bounce higher to increase game difficulty, though I think @ben should make note of it in the video.

Ah you guys are awesome, thought I did something wrong! Thanks for the solutions!

So I tried setting the Collision Detection to Continuous and it works, as well as setting the bounce factor to 0.98 or further. 1.005 will increase the bounce every time but as someone mentioned that will help make the ball faster when playing the game, so I will try that later if needed.

My only complaint with the Collision Detection solution is that the ball will go to one height, then slightly lower, then back up to the other height, back down to the lower height and continue in this pattern. Still, I’ll take the solution.

Thanks everyone for the great solutions!

Privacy & Terms