How on Earth do you run code on/during the async physics thread?

I have some physics code which is all working correctly with async physics disabled. I need to make the code work with async physics enabled. I need to do calculations based on the position and rotation of my physics object on each physics tick and I need to apply forces on that tick for the duration of that tick. I need access to the position and rotation from the last physics tick, not from the game thread tick or some interpolated value.

I’ve been researching and trying different approaches and I’m overwhelmed and confused by the mixture of information.

Some places say I need to register an FCalculateCustomPhysics callback, some say I need to override the AsyncPhysicsTickComponent function, some say I need to put values in a struct and send them to the physics thread to be processed. Some stuff mentions Chaos but some engine code references PhysX. I’m super confused.

I would love it if someone could tell me what method absolutely works so I can focus on researching and implementing that.

In Unity I would just do my work in FixedUpdate so if there’s a workflow I can use which is similar that would be great but, of course, not essential.

Hey there @PaulJeffsMT! So to clear some confusion, PhysX was the older physics engine, any time you see it, it’s going to be for mostly legacy stuff in modern versions. Chaos is the current physics engine.

From what I gather, AsyncPhysicsTickComponent doesn’t let you mess with the physics between the initial steps, so without an override like you mentioned I don’t know if that will work. I think FCalculateCustomPhysics is the closest equivalent to Unity’s FixedUpdate but I’m not finding a super concrete example.