1
\$\begingroup\$

I have read that in Unity 1 cube of size 1x1x1 and scale 1x1x1 is representing a cube in real life of 1mx1mx1m.

Now, the only setting I find, where I can input anything related to Units is gravity, which is usually 0, -9.81, 0. The Unit of the gravity is supposed to be unit/s^2, so an acceleration.

Therefore, I am wondering how to adapt/redefine Units in my project?

I want it to run in real-time, so the time would stay the same, but for the size, I want it to be in a mm space.

So, would it be possible to basically redefine the units inside the physics settings by changing the gravity (in this example by a factor of 100)?

I will not use gravity inside the project, but I want to define a force and I am wondering, if it possible to use this approach to define units in a way I want. (I want to apply a force of 1N on my objects for example and I am not sure how to do this while keeping the idea of the project the same without changing the distance?)

Or I could change the force to adapt to the units correctly, but anyways, I am not really sure how to define a force in this environment without setting the units.

What are the good approaches to set forces in Unity so that they accurately represent a physical system?

\$\endgroup\$
2
  • \$\begingroup\$ If you go really small or really big, engines tend to go funky. \$\endgroup\$
    – Zibelas
    Commented Sep 22, 2023 at 13:09
  • 1
    \$\begingroup\$ Note that there are lots of systems built on the assumption of 1 unit = 1 meter. For example, the doppler effect in sounds depends on the relative speed of the source/listener and it assumes 1 unit = 1 meter. Another example is VR. Other factors also come into play (like scaling shadow maps) which is one I hit myself: gamedev.stackexchange.com/q/204512/3770 \$\endgroup\$
    – Basic
    Commented Sep 25, 2023 at 10:44

1 Answer 1

1
\$\begingroup\$

If you make your units \$mm\$ instead of \$m\$, then you need to inject a factor of \$\frac {1000 mm} {1 m}\$ into any quantity that normally has an \$m\$ in its SI units.

e.g. I want to apply a force of 5 Newtons:

$$5 N = 5 \frac {kg \cdot m} {s^2} \cdot \frac {1000 mm} {1 m} = 5000 \frac {kg \cdot mm} {s^2}$$

So I'd use a value of 5000 instead (effectively, I'm now applying forces measured in millinewtons)

\$\endgroup\$
1
  • \$\begingroup\$ This is very likely to be more onerous and buggy than just writing your sizes / positions as 0.005 etc (i.e. expressing them as fractions of a meter, and leaving all SI units as-is) \$\endgroup\$
    – DMGregory
    Commented Sep 22, 2023 at 17:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .