Pawns not moving if spawned during demo recording

I am building an open world city with a bunch of cars on the road. All these car pawns are custom subclassed from Physx vehicles. These pawns receive input from a custom controller (subclassed from APlayerController because of some funky reasons, despite being full AI cars) and pass it on to their physics components using GetVehicleMovementComponent()->SetThrottleInput(), etc. Because the physics simulation are CPU-intensive, the vehicle controllers de-spawn their pawns (and themselves) as soon as they go off-screen or have not moved in a certain amount of time, and the game respawn new ones around the player to keep up the appearance of traffic without using too many physics vehicles.

This works great, until I start a demo recording. Any new AI vehicles spawned after the start of the demo recording do not respond to input commands sent from their controllers. I can verify that the newly spawned controllers are generating non-zero input commands, and that the vehicle pawns are passing them on to the vehicle movement components correctly, and that these movement components are not ignoring inputs. Their controllers still de-spawn vehicles after going offscreen or a period of no movement, so they are in control to some extent. Existing AI vehicles that existed before the start of the demo are fine and will drive around.

Once I stop the demo recording, these previous non-responsive pawns suddenly start reacting to inputs and will start driving around. So I want to believe that it’s something to do with the physics or controls not being replicated in some way. i’ve tried a bunch of things, such as setting bAlwaysRelevant on the controller/pawns, calling ForceActorRelevantNextUpdate on the demo net driver on the vehicle, but all to no avail. Any help?

Fixed. Without a deno recording running, all controllers are spawned as local controllers. During demo recording, there is a DemoNetDriver that actives networking. All new vehicles have controllers spawned as non-local controllers whose inputs are not replicated (I think?). After demostop, there is no more networking and the controllers revert to being local controllers. Calling [SetAsLocalPlayerController()][1] on the newly spawned controllers during demorec fixes the problem.