Is it possible to perform logic on each physics substep?

A comment to this question suggests that it is possible to apply forces at the substep level:

If you go this route and want even more accuracy you’ll want to apply forces at the sub-step level. If you look at the vehicle code we actually do this, but the way we do it is not very extensible. There is a plan to make this a more generic system that you can plug into, but that won’t be in for a little while.

Before I continue to search for days, I would like to get an official answer to the simple question: Is it possible to perform logic and alter forces on each substep? And if yes, how?

If the answer is just “no” I’ll gladly accept that. I guess I shouldn’t have asked on a sunday after all!

There many funtions you can override and attach your code, explore API refrence, theres all funtions listed and whats there job and override it if you think thats place for you code

Thank you, but I am unable to find anything regarding sub-stepping, other than the (only internally used, undocumented) PhysSubStepper. There doesn’t seem to be an appropriate event.

This is technically possible, but it’s not extensible at all right now. You’ll see that in the vehicle code we have a vehicle manager that is ticked from inside the sub-step.

We’re planning to add a general system for this eventually, but for now there’s no easy way to do it short of adding it to the physics sub-step code.

Also note that the sub-stepping happens on a different thread so using logic based on the game state is not valid, and this would really need to be limited to things like adding forces etc…

Thank you very much for this answer. I guess that means I’ll leave everything frame-based right now and change it eventually when such a system should be added. Is there a card on the trello roadmap for this matter that I can follow?

There isn’t but I’ll be sure to add it to the release notes when it’s out

For those finding this, this pull request appears to implement it (and has been integrated in to master here) and seems to be working as expected