Download

Spawning actor during demoplay

Hi!

I have a problem with spawning a PlayerController in a demoplay.

The PlayerController in demoplay is spawned by ULocalPlayer. My subclassed UMyLocalPlayer::SpawnPlayActor() does not get called, so I can’t spawn my custom PlayerController.

When getting back to UMyLocalPlayer with the FCoreUObjectDelegates::PostDemoPlay delegate I can’t spawn any actors because


check(CurrentLevel)

in UWorld::SpawnActor(…) crashes (CurrentLevel is NULL).

How would I go about using my own PlayerController class during demo playing?? I guess the demo framework is a very special one…

Resolved using own spectator class: DemoPlay can't spawn custom spectator class - UE4 AnswerHub