Validate forces on rigidbody just before physics update?

I have several game objects with the same components. This component adds forces to the rigidbody in FixedUpdate. Furthermore, other parts of the program not in FixedUpdate might add forces to the rigidbody.

Before the physics update runs, I want to validate the forces. Is there some kind of callback I can use? Something like OnPrePhysicsUpdate?

Furthermore, I need this script to be reusable. Ideally, it should work immediately after attaching the component. No other work required or subtleties to remember.

For example, Peter G’s post to this question explains how to use events to get a callback just before the physics update. However, this method requires the programmer to register event handlers instead of using FixedUpdate. This is counterproductive because if I add this script to an old project, then I have to change any script that uses FixedUpdate to register an event handler.

Untested: pick a FixedUpdate, maybe the one on the object, and use script execution ordering to make to run last. Validate there.

FU runs before the physics step, according to the docs. But I think the physics step might apply gravity and friction before moving (which is why setting everything to 000 in FU doesn’t quite freeze the object?)

void LateUpdate()


LateUpdate is called after all Update functions have been called. This is useful to order script execution. For example a follow camera should always be implemented in LateUpdate because it tracks objects that might have moved inside Update.