- Home /
How to correctly scale a mini golf game
Earlier I posted a question regarding some weirdness with a simple ball and surface simulation. My intention was to create a mini golf game in Unity. I created everything to scale in Unity. A ball which was 0.0427 in diameter (a golf ball is 42.7mm) with a mass of 0.04593 (a golf ball weighs 45.93 gram).
Next I created a terrain which was flat, 8 x 4 and a controller to apply force to the ball.
All seemed fine except for the issue I posted here. With all of the above, the ball kept flicking upwards in certain directions. I eventually figured out this was something to do with the terrain size and if increased, the ball would move as expected in all directions. All good and well. The same happened with custom made 3D models. If I made a model to scale, I would have the same issues with the ball flicking up or colliding against nothing - but scaled up to 10x the size, it worked fine. Perfect, except...
After scaling up the size and mass of the ball and course, everything now seems to run at a horribly unrealistic, sluggish pace. The ball stays in the air for a silly amount of time. I tried fiddling with gravity and various other settings - but couldn't get it to feel realistic or responsive.
SO...
My question is - how am I meant to correctly scale this? If I scale it to 'actual' scale, I get strange collision issues with the terrain and 3D models. If I scale it up, it plays awful. Is there a recommended way I should be doing this?
Thanks in advance, JM
Answer by Owen-Reynolds · Aug 19, 2015 at 01:03 AM
Should be able to find old info about small-scale Unity scenes. But some comments and things I remember:
For gravity, did you really go nuts on it? I think it's linear, so blowing size x10 should need gravity of 98.0. Just to check, use the standard bracketing trick. Set gravity to the-thousand. If that turns the floating problem into a lead balloon problem, you know there's a correct gravity somewhere in the middle.
Physics uses a slop-factor minimum penetration distance of about 1/2 a golf ball, which is fine for regular stuff; but bad for golf balls. Could decrease that.
The terrain mesh size can be decreased to give a reasonable resolution at golf-ball sizes.
There's probably a lot more, with just a general search like "unity small scale."
Interestingly, I found something in between which seems to work. If I generate a model in my 3D package at 10x the size but then scale down to 0.1 in unity, I can keep everything else at small scale and it seems to work. I just discovered this last night, so still needs more testing. The bit I'm struggling with, is WHY does that work? I will however do a search on unity small scale and see what I can find. Thanks.
Answer by GraviterX · Aug 18, 2015 at 11:48 PM
Sometimes when colliding with colliders, rigidbodies will bounce or go straight though the collider. I had a problem with that the other day. Try this: http://answers.unity3d.com/questions/255689/rigidbody-object-falling-through-floor.html
Hope this helps.
Your answer
Follow this Question
Related Questions
2D 360 degress platformer example needed 0 Answers
shrinking mass and scale 1 Answer
How to scale down physics engine 2 Answers
Physics and very "small" objects. 1 Answer
The REAL size of an object. 3 Answers