I notice that for smaller values of Physics fixed timestep, my fixed joints explode with too much force (and the break force needs adjustment). Why is this? And what units is break force in, anyway?
I’m mostly sure that the break force units is in newtons, but as representation of an impulse. Impulse = force x deltaTime. Thus, the smaller deltaTime the more force is used to represent the same impulse.
I’d configure the break force from scripting based on a given impulse value. I’d translate that impulse to break force as break force = break impulse / deltaTime. This would allow to define an invariant magnitude (break impulse) that should work the same regardless the deltaTime used.
Ok, but what about the forces imparted back onto each object? With the default timestep it works reasonably well, however with a shorter timestep, my objects get far too much velocity and pop apart in a very unrealistic way. Not even like its just gone totally bonkers, but that it shoots off with 10x times too much force. I am dropping a small spaceship with legs from 10m high, and when it touches down, the legs break off and my ship shoots up again hundreds of meters. No attempt at conservation of momentum going on ![]()
Oh, forget about precise conservation of momentum in Unity / PhysX. It’s yet another aspect that is heavily faked against laws of physics supposedly in favor of optimization (the other big fiasco is friction). I’ve given up trying my vehicles to have realistic collisions since Unity 5 (this worked much better in Unity 4). I’ve even thought on computing the momentum explicitly on each frame for preventing sudden unrealistic changes.
When PhysX detects that two objects interpenetrate the “solution” is just throwing them apart at an arbitrary velocity that resolves the interpenetration. This velocity doesn’t relate with momentum, masses or anything I can figure out. Moreover, by default the maximum magnitude allowed to this “depenetration” velocity is… infinity. The only workaround available is to configure Rigidbody.maxDepenetrationVelocity to a reasonable value (7 - 10 m/s improves things to me). Not sure if this would improve things in your case, but I think it worth a try.
I’m not looking for perfect conservation of momentum. I just want it to not look like this:
Even my wife fakes it better than that.
I have the opposite, shorter time steps create less reactions in the joints. But… I’m only using one type of joint, the WheelJoint2D. My theory on why it’s lesser forces, in my situation, is that the shorter time step means the out-of-ideal range achieved in a lesser time is less, so less force is used to correct.
btw, You win the unofficial, funniest post award for Unity forums. Sadly, there was no second or third place.