Networked Physics with PhysX

There is a class in the engine that creates the scene in the constructor ( FPhysScene ) but you have to manually transfer actors between scenes, also another thing to note is that you have to create a new UWorld for the tracing so it can use the new physics scene. Also PxActor can only exist in one PxScene so you have to transfer all static object just before the correction happens and transfer them back before the next tick/substep is called. You have to do it before the next tick because ue4 does a check for each BodyInstance to see in which scene it exists, if it is not in the main scene ue4 will crash. Not sure if there is a way to copy PxActor so I can have an identical copy of it.

I manually call simulate on that scene, PxScene::simulate(float DeltaTime).

I am not adding force, I’m directly setting the transform and velocity. If update rate is at 30Hz there is enough time to smoothly perform the corrections. I’m allowing a small percentage of error.