x


How do I change the Unit size for a project?

From what I've read, Unity defaults to 1 unit = 1 meter. This sounds good to me, but I'd like to verify that the project I'm working on is indeed setup this way. I can the the gravity setting is currently set to -40 instead of -9.1 which makes me think that the project scale is set to something else. Is there a "Unit Size" setting somewhere? A lot of people have been saying that unit size does not matter as long ass everything is scaled together properly but I'm not sure. From what I can tell, gravity, the speed of sound and some other things will be affected. I can't find a Unit setting in the project settings, is it perhaps a unity pro setting only?

more ▼

asked Nov 22 '11 at 03:37 AM

imnickb gravatar image

imnickb
258 13 17 21

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

A unit is a unit, so there's nothing else to set it to. Units are arbitrary, and only mean what you say they mean. If you put gravity at -9.81, then that means units are meters as far as physics goes, as long as you assume Earth-normal gravity. If you use 343 for the speed of sound in the audio settings, that means 343 units per second.

more ▼

answered Nov 22 '11 at 05:40 AM

Eric5h5 gravatar image

Eric5h5
80.3k 42 132 521

I know this is old, but isn't the physics engine optimized to handle objects as if 1.0 were actually a meter? In other words, yeah it's easy to adjust gravity (etc.) to make the units feel correct, but then don't you run the possibility of having the physics engine have a less reliable simulation?

Basically what I'm really wondering is: does Unity's Physx have similar unit requirements/restrictions to Box2D? This is from the Box2D guide:

"Box2D works with floating point numbers and tolerances have to be used to make Box2D perform well. These tolerances have been tuned to work well with meters-kilogram-second (MKS) units. In particular, Box2D has been tuned to work well with moving objects between 0.1 and 10 meters. So this means objects between soup cans and buses in size should work well. Static objects may be up to 50 meters big without too much trouble.

Being a 2D physics engine, it is tempting to use pixels as your units. Unfortunately this will lead to a poor simulation and possibly weird behavior. An object of length 200 pixels would be seen by Box2D as the size of a 45 story building."

Dec 10 '12 at 03:00 AM MattRix
(comments are locked)
10|3000 characters needed characters left

If you create a default cube in your scene, it will be set up as a 1m cube. If what you are concerned about is making sure that objects that you import in are at the proper scale, just set up a scene in your 3D platform, create a 1m cube in it, and then make sure that the cube you import from your 3D platform is the same size as the default cube in Unity. The other thing to keep in mind is that size does matter when it comes to physics. My advice would be to always work in real world units (1 unity unit = 1 meter). Might not matter in some projects, but it is just a good habit to get into... and as you build your own asset library it will make things much easier!

more ▼

answered Nov 22 '11 at 07:06 PM

ChefZweegie gravatar image

ChefZweegie
111 1 2 4

The default cube is 1 unit, not 1 meter.

Nov 22 '11 at 07:19 PM Eric5h5

Right. Usually you do not really need to worry about any of the scale until you use physics. Here is the link for a more in depth explanation:

http://unity3d.com/support/documentation/Components/class-Rigidbody.html

I've always made it a requirement to have everyone work with this in mind and never had any problems, person around 2m, car around 4m... and so on. It makes sense when you read that page.

Nov 22 '11 at 09:58 PM ChefZweegie

I should add... the info about needing to think in meters is down towards the bottom... but the whole page is a good read.

Nov 22 '11 at 09:59 PM ChefZweegie
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x464
x388
x31
x24

asked: Nov 22 '11 at 03:37 AM

Seen: 2090 times

Last Updated: Dec 10 '12 at 03:00 AM