# How does physics substepping in UE5 work?

**URL:** <https://forums.unrealengine.com/t/how-does-physics-substepping-in-ue5-work/654384>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [September 22, 2022, 10:28pm UTC](https://forums.unrealengine.com/t/how-does-physics-substepping-in-ue5-work/654384 "2022-09-22T22:28:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Batrox25](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Batrox25](https://forums.unrealengine.com/u/Batrox25)\
**Post date:** [September 22, 2022, 10:28pm UTC](https://forums.unrealengine.com/t/how-does-physics-substepping-in-ue5-work/654384/1 "2022-09-22T22:28:06Z")

</div>

I need my game to be framerate independent meaning i want that if i apply a force 10 seconds to an object, the object should always end up at the same location (± a few cm).  
As far as i understand, you can enable substepping which makes physics time step fixed.  
So i enabled substepping and set max substep delta time to 1/60.  
Now, when i call this in the normal tick function of my actor…

> MeshComp-\>GetBodyInstance()-\>AddForce(FVector(1000000.f, 0, 0), true);

…the actor ends up at the same location only when i set fixed frame rate to 30.  
When it’s 60 though, it doesn’t work anymore and the actor always ends up a few meters apart (while also only moving not more than 10 meters, so the difference can get up to like 50%). This might be because my machine only runs the game on 40 fps. But then substepping doesn’t do what it should, i suppose.

Now i wonder if i’m doing something wrong with this add force function, maybe it doesn’t need to be in tick but somewhere else?  
Or does substepping in general work differently?

I would be glad for any hints.

---

<div class="post-metadata">

**Author:** ![Termitosss](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/termitosss/32/88716_2.png) [@Termitosss](https://forums.unrealengine.com/u/Termitosss)\
**Post date:** [October 18, 2022, 1:48pm UTC](https://forums.unrealengine.com/t/how-does-physics-substepping-in-ue5-work/654384/2 "2022-10-18T13:48:01Z")

</div>

Substepping worked in UE4 but it required adding custom physics as described here [Physics Sub-Stepping - #14 by toxygen](https://forums.unrealengine.com/t/physics-sub-stepping/3565/14?page=2)

Unfortunately this doesn’t work in UE5, custom physics only gets called once per frame.  
It seems like in UE5 substepping works only internally, with no access for the developer.

The only workaround that I know of is this Async Tick Physics plugin - [Exposing UE5 TickPhysicsAsync Event - #3 by Claigo](https://forums.unrealengine.com/t/exposing-ue5-tickphysicsasync-event/271744/3)

---

<div class="post-metadata">

**Author:** ![Batrox25](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Batrox25](https://forums.unrealengine.com/u/Batrox25)\
**Post date:** [October 22, 2022, 4:55pm UTC](https://forums.unrealengine.com/t/how-does-physics-substepping-in-ue5-work/654384/3 "2022-10-22T16:55:44Z")

</div>

thanks, i just ended up integrating bulletphysics into the engine, where i can easily call the physics calculation function by myself. This allows me to call it n times in a tick, where n is the amout of substeps that i can calculate with the deltatime. And bulletphysics is deterministic. So in this case, all my problems are solved

---

<div class="post-metadata">

**Author:** ![QuasiBear](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/quasibear/32/678838_2.png) [@QuasiBear](https://forums.unrealengine.com/u/QuasiBear)\
**Post date:** [October 21, 2024, 4:05am UTC](https://forums.unrealengine.com/t/how-does-physics-substepping-in-ue5-work/654384/4 "2024-10-21T04:05:50Z")

</div>

> [@Batrox25](#):
>
> a

Did you do this through a blueprint?
