Hello. I’m playing around Chaos and possibilities it provides. I’ve set up an actor, containing a static mesh component as a root, of mass 100 kg. The Actor is rotated 30 degrees to point towards ground. Also I’ve added a PhysicsConstraint component, locked the movement to X axis, as on image:
[Image Removed]
So the body moves under the gravity towards the ground.
Now I want to counteract this movement, by applying opposing force to stop the body in Tick, tick group is set to TG_PostPhysics:
FVector Velocity = Mesh->GetPhysicsLinearVelocity();
const double Mass = Mesh->GetMass();
FVector ForceToStop = -Velocity * Mass / DeltaSeconds;
Mesh->AddForce(ForceToStop);
This leads to body slowly, but constantly sliding towards the ground (video 2025-05-05 01-18-22.mp4).
So I’ve added a “warm start” - reapplying the force from last frame together with current force:
FVector Velocity = Mesh->GetPhysicsLinearVelocity();
const double Mass = Mesh->GetMass();
FVector ForceToStop = -Velocity * Mass / DeltaSeconds;
FVector ForceToApply = ForceToStop + LastApplied;
LastApplied = ForceToApply;
Mesh->AddForce(ForceToApply);
This looks better, but jiggles back and forth. This is almost unnoticeable at 120+ FPS, but pretty noticeable at 60/30 Hz.
Async Physics are not used, solver iterations set to 8/8/4, also tried 16/16/16, same result.
I’ve seen ChaosVehicles uses the similar formula for braking, in WheelModule:97
float ForceRequiredToBringToStop = MassPerWheel * K * (LocalWheelVelocity.X) / DeltaTime;But I still wonder, what is this K coefficient, and why it equals to 0.4, and how this helps in stability.
Some similar questions were asked here: [Wheel system [Content removed]
Then I set up a different and simpler test - an Actor with a Cube mesh as root, without a constraint, which falls to the ground. I was trying to counteract gravity by applying a force F = -mg. Apparently box slides down slowly too.
I’ve added a BP project (see attachments, EPS_Test) to reproduce the case: box with force counteracting gravity, box with constraint and counteracting velocity, box with constraint and counteracting velocity and warm starting.
Could you help on these questions? What am I missing?
p.s. to note, I had to disable Chaos sleeping globally, since I was working on bodies with way higher masses, e.g. 100-150 tons, otherwise they do not start moving after stop (too little force applied?)