Physics in relation to Transform scale

Hello,
I have difficulties understanding the relation of transform scale on the physics system.
As we read everywhere to keep the scaling based on a 1m standard, this is what I originally did.

let’s consider a pinball game, completely vertical.

Scene 1:

  1. the table board is around 1m tall
  2. its width is around 50cm
  3. the flippers are around 7cm long
  4. the ball is a sphere scaled down to 0.02

Scene 2:
Everything is scaled by 50 (I insist: only the transform)
The ball is scaled to 0.5 (Don’t ask me why not 1, it just looked good this way).

The mass of everything is the same.
The spring force of the Hinge joint controlling the flippers are the same.
Basically rigibodies are the same.
Only the transform scale is changed

In scene 1:
when the flipper flips on the ball it merely goes upward by few centimaters.

In scene 2:
the ball easily reaches the top of the board.

So the question:
why in a 1m transform scale, can’t the ball reach the top,
while in a 50m transform scale, it can easily be propulsed there,
while having same mass, drag, angular drag, spring force, …

Probably it has to do with the inertia tensor of the rigidbodies (Rigidbody.inertiaTensor and Rigidbody.inertiaTensorRotation). This parameter is calculated automatically by default, and its value depends on the actual shape and dimensions of the colliders belonging to the rigidbody. Compare the inertia tensor between both scenes and you’ll surely find huge differences.

Hello,
thanks for the answer.

I have just checked:
the ball inertia tensor is always (0.0, 0.0, 0.0)
the flipper inertia tensor is always (1.1, 0.0, 1.1)
the flipper intertia tensor rotation.(0.0, 0.0, 0.0, 1.0)

As far as I understand those values are related to rotation.
My issue is already for the “upward direction”.
The ball does not touch the table board itself and is locked in the Z axis position (I only have colliders for the border of the table). It is completely in space.

Just found out that if I divide the gravity by 50 (-> set it to -0,1962) the scale 1 scene behaves like the scale 50 scene under the standard -9,81 gravity.

I totally do not understand this phenomenon by thinking in similarities in real life.
If 2 objects have same mass, force applied, etc … No matter their size they will travel the same distance, right ?
Concretely I’m thinking of the ball, and the force applied by the flip (actually: hinge)
Where is my understanding of real physics wrong ?

If I’m correct, this would mean that the scale factor actually has an influence on the rigidbody gravity (or other hidden parameters).

Edit: just checked the velocity of the ball and, as expected, I see the a difference by this factor in both scenes.
Same gravity, same mass, same drag, in short, same everything, but different scale = different velocity.

It’s an old post, and I just stumbled here by accident, but I cannot resist asking “How?”
If two objects have the same mass, and forces applied, yes they will travel the same distance.
But if one object is 1 cm in size that distance is incredibly different when compared to an object of 1 km.
You need to get your scale right.

I am also interested in how to actually scale in Unity with physics. I understand that small object just “move faster than big objects” and it has something to do with the volume. But how to properly re-adjust Unity’s physics to counter this?? I really do not want to work on scene 1x1m as everything gets really tiny and Unity as usual still does not have a good solution to this after so many years

I don’t know any of the repercussions of this for Unity, but from a physics perspective you need to have a consistent unit system, you cannot arbitrarily change one dimension’s unit scale without considering the other dimensions.

Take a look at the rules at the top of https://www.dynasupport.com/howtos/general/consistent-units and the examples in the first 4 columns. This is from some commercial engineering software, but the same rules should apply.

You can see from here that if you want to go from m to km, then you need to take your mass units from kg to g if you want to keep time and force the same (which you probably do).

I see that The PhysX API — NVIDIA PhysX SDK 4.1 Documentation there are some options to allow these corrections to be done by PhysX, but I don’t believe they are exposed in Unity (I may be wrong). I also see you can set some tolerances in PhysX, but I don’t believe they are exposed in Unity either.

I suspect that switching to km is going to cause all sorts of precision issues when looking at objects close up and that this is not a desirable approach, but perhaps it helps address the basic question.

1 Like

I have a similar use case as the original poster, with a scene of about a square meter and objects with a size of a few centimeters, weighing as little as a few grams.

When using unscaled objects of the correct size, setting mass to e.g. 0.002, and keeping default physics settings, I have been experiencing non-physical behavior by the small objects, like constantly rotating in place after collisions and refusing to fall over.

I’ve found some posts recommending to work at meter scale and adjust gravity and some other physics settings to get the desired behavior. I tried and had limited success so far. Also, I hate this approach because it requires mentally transposing things all the time and it should not be possible, if consistently scaling the physics simulation is supported.

So I set out to have a closer look at the PhysX documentation and came across the same section mentioned in the previous post on Using different units. And indeed:

“PhysX is designed to produce correct results regardless of the units of length or mass, so long as inputs use those units consistently. However, there are certain tolerances values whose defaults need to be adjusted depending on the units.”

Specifically, there is an example where the PxTolerancesScale parameter is set for a specific combination of object size and units used. That seems exactly like the thing needed.

It would be extremely helpful if someone from Unity could comment on whether that parameter is exposed in some way in the Editor or can be set some other way. If not, is there any other way to handle this cleanly and reasonably?

The thing I’m wondering about here is this: do we really need to choose between meter and centimeter scale for physics simulations. Should it not be possible to have a scene with, say, a meter-sized room with a table on which there are cm-sized objects being simulated, e.g. dominoes?

I’ll try to get to the bottom of this but any help would be greatly appreciated :slight_smile:

@USIRG Have you checked out the two Physics panels in the Project Settings?

But other than that, physics is a deep topic, and you shouldn’t expect a perfect simulation, although it is most definitely highly tweakable. And this is exactly because everyone’s scenario is supposed to deviate from some real-world standard. However, a general standard approach is recommended, at least until you get a good grasp on the underlying computation, approximation and inevitable imprecision that comes along with it.