Hey y’all,
I’m fighting with Sublevels and need some directions to go please.
So I have a persistent level with a bunch of sublevels that have Sequences (Cutscenes) and I only load them into Level when I want to play those cutscenes.
In those sublevels I have an actor called “CutsceneLoader” which basically gets those sequences so I can control them with my player Blueprint since I can’t access Level Blueprints in UE.
This is what the CutsceneLoader is doing basically:
Everything works just the way I want to except when it doesn’t.
After loading the sublevel as you see in the first image I immediately play the cutscene which does work sometimes but gives an error other times.
Blueprint Runtime Error: “Accessed None trying to read property CallFunc_GetSequencePlayer_ReturnValue_1”. Blueprint: CutsceneCamera_SubLvl Function: Execute Ubergraph Cutscene Camera Sub Lvl Graph: EventGraph Node: Play
I thought that the “Completed” property of the “LoadStreamLevel” means that everything got loaded and I can use all actors of that sublevel like I want.
But it seems like there are some race conditions which sometimes work in my favor and sometimes don’t.
So the question is - How do I load a sublevel and play the sequence in it without breaking it sometimes?
Dirty fixes I could think of would be:
- After loading the sublevel, make a Delay of 1-2 seconds before playing
- In the CutsceneLoader check if Sequence is null. If yes, Delay and try again