- Home /
How do you change measurement units in unity?
I know that Unity uses meters by default, but I want to be able to change that. I have had multiple scaling issues while making my building in 3ds max, and I want to have access to the units settings for unity to double check that it is right now. I know that similar questions have been asked before, but they only tell how to change gravity. I need to change DISTANCE and MEASUREMENT units. Gravity is working just fine for me right now.
Answer by DaveA · Jul 08, 2011 at 02:18 PM
You could make a converter class which multiplies everything by the conversion factor, but it sounds like this is an issue for importing 3ds models. I would look into a post-processor on the model importer, see http://unity3d.com/support/documentation/ScriptReference/AssetPostprocessor.OnPostprocessModel.html Basically after the model loads you could wrap it in a transform which applies the scale, or crawl its hierarchy to apply the scales, or modify the meshes, etc.
Answer by Joshua · Jul 08, 2011 at 02:20 PM
Units of distance and scale are meaningless and relative to nothing. Call them meters, inches or lightyears, it affects nothing.
The only thing that it does affect if force and velocity calculations by the physics engine. But since you control this all you have to do is take it into account. The only hardcoded place where you need to adjust the force is under gravity settings, because all the other physics settings are done through code by you yourself.
So to change the units of measurements, pick a word for how you call them (mine are Joshuas, plane that is 9 square Joshua). Now decide what the scale of this unit is compared to meters (mine are 1! :p) and divide the gravity by that. From there on it's just a matter of imputting the right force and velocity variables.
So the reason all you can find on changing measurements is changing gravity is because changing measurements is useless, as they are meaningless units. They are just used by the physics engine, so change how it uses them.
hm... Well that's kind of frustrating. I'm making a mall that you can walk through and I'm trying to make it close to the actual dimensions of the real building. And now I have to make the texture for the parking lot in photoshop. so will i just have to guess on the dimensions for that texture?
All relative scale will always stay correct of course, as long as the object's scale is 1,1,1. So this doesn't affect the dimensions of your texture in any way, they are deter$$anonymous$$ed by the dimensions of your model. A two by one floor will remain a two by one floor.
You just have to 'forget' the meaning of distance, and do everything by scale. Which is fine, because that's also how you're supposed to model and texture (although I have no experience with that).
wow... i now accept that once you begin 3d design in general, you must ignore half of what you have learned about everything. I think it's that way for most new concepts though.
True that. And for textures, things like 'dots per inch' are also meaningless. For models though, since many other modeling programs DO have units, it's nice to keep them consistent. So if you make something in Sketchup and something else in $$anonymous$$ax, you need to worry about your 'arbitrary' units.
That's true, they are relative to eachother, so they do have meaning in that sense. I'm guessing this can be fixed by figuring a good import scale per modeling tool you use. But I have no experience modeling, so I don't really know. But for fixing this doing what $$anonymous$$A suggested in his answer seems like a good solution.
Answer by Cnotey · Dec 03, 2011 at 07:56 AM
I have been struggling with this as well. The consensus is that they are "units" and not meters. But as an architect I strongly disagree with this school of thought. Units are relative to your daily life, just as language is. How are you supposed to reference a word if you don't know the language?
Measurement units are all about reference and your point of view.
So for all of you out there struggling with this, the answer is simple. If you are using 3DS Max or Maya, simply just build whatever you are building as if each unit was 1 foot. Then, right before you export it, scale your entire scene up * 0.3048.
This will make it come into unity at the correct scale, and also allow you to model at a relative scale.
$$anonymous$$easurement units are dimensionless, always. Unity doesn't make any judgements about how long you want your things to be, but the physics engine does assume metres (for gravity) by default. Other than that, nowhere in Unity does it presume to tell you how you should be interpreting the size and length data it presents you with. From an architecture point of view, well of course for architecture you need things that relate to the real world, but nothing in Unity explicitly links to anything outside of it.
Right, Unity is a general 3D engine, you're not going to be dealing with human-sized buildings all the time. It doesn't make any sense for units to be anything other than arbitrary, otherwise the engine is placing too many restrictions on you.
The documents say otherwise.
As I said before, the entire reason for measurement units is for reference. If I want to draw a soda can in unity, I know from personal point of reference that it is approximately 5" tall. So of course, naturally I want to draw it in Unity to scale. Why not just make everything to relative scale?
This has everything to do with Unity! If I want to make a scale version of an $$anonymous$$14 rifle, I know the real work reference dimensions, and it's easy to model it as such. So that is the reason to model everything to scale. So from a point of reference, they are all scaled equally to each other.
You can arbitrarily scale everything in unity. So long as everything has the correct scale in relation to everything else, there's no problem. The 'gravity' value in Physics is the only place where it defines how long the unit is, and only in situations where the gravity should be the same as on earth. This value can be changed to anything you like, in any direction you like- so it hardly creates any kind of limitation at all.
Also, don't post comments as answers. It's basically the wrong thing to do.
No, the docs don't say otherwise.
Why not just make everything to relative scale?
Like I said, Unity is a general 3D engine, and you're not going to be dealing with human-sized scales all the time. A space game, for example, dealing with interplanetary distances (or even interstellar distances). Units are units, nothing more. They are what you say they are.
Answer by Xavier78 · Aug 25, 2019 at 10:44 PM
Now with VR they have actual meaning. They are everything for VR!
Your answer
