I tried to ask this question also in UE4 Answerhub, but lastly had problem with “question need moderator approval”. But it may be interesting also for the forum.
I’m trying to get realistic results values in order to build some simulation - I don’t need real time simulation, thus, I would like to use UE4 with a good physics calculations even if it takes cpu time.
I did a very simple test for moving a cube over a floor with some friction, but got values that are not fit to the simple physics equation.
First experiment - zero friction
I set a physical material with zero friction for both, a floor and a cube, then add one shot of force of 1N to the cube within axis x:
- FPS = fix 40fps (so tick time step = 0.025s)
- Gravity = -2000cm/s^2 (just in order to have nice numbers)
- Cube mass = 1kg
- Physical Material Friction = 0.0
- addForce = 1N
The change of velocity should be:
- TickStepTime = 1/fps = 0.025s
- addForce = 1N
- velocity change after one shot of force = 1N*0.025s/1kg = 0.025m/s = 2.5cm/s
And this is exactly what I get
Second experiment - friction value = 0.025
At this time, the expected kinetic frictional force should be:
- weight of cube = 2000cm/s^2 * 1kg = 20N
- the kinetic frictional force should be then = 0.025 * 20N = 0.5N
The change of velocity after the force shot should be:
- TickStepTime = 1/fps = 0.025s
- addForce = 1N
- kinetic frictional force = 0.5N
- velocity change after one shot of force = (1N-0.5N)*0.025s/1kg = 0.0125m/s = 1.25cm/s
But the results are strange - velocity is not only at x axis, and there even ticks where the x velocity is negative as shown in the snapshot. Even the first velocity value is 0.396 cm/s and is absolutely far from the expected value 1.25cm/s
I will be glad for a help for understanding how to fit the UE4 physics behavior to the expected values, or maybe there is different way to use realistic physics in UE4?
Thanks.
========================================================================
Settings and cube blp snapshots attached here
========================================================================