- Home /
Using millimeters to move object
Hey there,
I know that Unity uses units and not exact meters, centimeters or millimeters for measruement, or better said: the units might be what I want (as long as it doesn't get to physics), but for my prject I need to move different objects in an exact range of millimeters. So let's say my object has a size of 5m x 3m x 2m, I need to move another object exactly 5cm on the xAxis of the object. How can I manage this? Sounds ridiculous, but the issue is, that by importing the fbx, unity sets every value to 1 (so the size of the object is 1 x 1 x 1) or to the scale the object has in the 3d modeling tool (for example 10), so my measurements are lost... Maybe I'm just missing something? Would be thankful for every help! :)
uuuuups...got confused, sorry! what i wanted to say is, that unity takes the object which is being imported and scales it, and the size in meters of the object is then no longer accessible...
Answer by Andres-Fernandez · Jan 27, 2015 at 11:49 AM
Unity scales the object (actually scales the mesh when importing) differently depending on the format (for example .fbx has a 0.01 scale factor and .3ds has a 0.1 factor). Check the docs here.
What you need to figure out is your scale and then move the object according to that.
Thank you!
I found the option and set the scale to 1, but the movement still didn't work out as intended. I don't know what didn't work as I wanted, but the object's position wasn't changed in Relation to the world, but to the parent or something. But: The scale was right, so that 1 unit equals the unit I want (mm), so I just created an empty object and set it as parent of the object I wanted to move, and now it works...somehow o.O
You usually set the scale factor to fit Unity units (which is considered 1 meter). You can easily check that by adding a cube to the scene and comparing it to your model. If your model is 1 meter tall it should be 1 cube tall, 2 meter tall should be 2 cubes tall, 3 meters tall equals 3 cubes tall and so on. If your model fits that, then you can move a milimeter by moving 0,001 units.
I'll check that! Thank you very much for your help! :)
Your answer
Follow this Question
Related Questions
the measurement units in Unity2.61 2 Answers
How much is a meter in Unity? 3 Answers
Units of measurement in Unity 2 Answers