Physics + small objects... what is the better solution?

I am trying to simulate a ball rolling around a surface. In the real world the ball is about 1.5 inches in diameter. I know that Unity’s physics system doesn’t like very small objects. I see 2 possible ways to approach this problem:

  1. Scale everything in the world up by a factor of 10 or so
  2. Tweak the project physics/time settings

This project is intended for the iphone. The ball should be the only ridged body in the scene, everything else is just something for the ball to bounce off of. Which would be the better approach?

it is very important for physics based game to build them in correct scaling, you should rather change the following values (under edit / project settings ):

physics / min penetration for penalty (lower is better)
physics / solver iteration count (higher is better)
time / fixed timestep (lower is better)

Actually I had much better luck scaling things up and changing gravity/timescale. Also that’s faster than changing the physics settings for solver iteration count etc., particularly for the iPhone where you want to use as minimal settings as you can get away with.

–Eric

well, fixed timestamp is the only parameter that changes performance, you should only need to change it if you make something with high speeds, like a race sim. the unity manual suggests to keep in scale. i did not find it right away, but it is somewhere in the manual. i guess unity technology knows what they are doing :wink:

most important parameter for small scaled scenes should be ‘physics / min penetration for penalty’ and you can put it as low as you wan’t to without any performance problems

Within reason. What they’re talking about is stuff like not having cars that are 50 meters long because that won’t behave right with the default settings. You are quite free to change the default settings when it suits your purposes, however, and there’s no reason not to when the scale is big/small enough. It works better to scale objects instead of trying to force the physics system to work with numbers where the limited precision causes problems. If it used double-precision floats it would be a different story, but it doesn’t. There’s no drawback to scaling your objects (aside from having to play around for a bit to get the right feel first), so that’s what I’d recommend, when the scale gets down to around an inch for the objects. This comes from experience.

–Eric

From todays testing it looks like I am going to have to use a combination of both. I did scale all of the objects by a factor of 10. I dropped the ball from several places at several heights and the ball was still falling through the floor on some of the drops. I’m not looking for a completely accurate simulation, just a believable (and predictable) one.

I agree the ‘physics / min penetration for penalty’ setting is critical for small models! And easy to overlook if you are just getting started.