Adding actors and components to a custom ALevelScriptActor

I’m trying to add default actors and components to my custom ALevelScriptActor based levels, my code compiles with no problems, but does nothing. I’m new with Unreal’s API, is there a better/correct way to do so?

PS: The intellisense error is caused by this know issue [UE-62042][2]

Do that on AGameMode, level script is to contain level specific code (via Level Blueprint) and only reason why you want to add C++ code is only if you want to send data to it like event and such. Probably Level Blueprint processing mess with component.

I personally used AGameMode multiple time to add post processing screen effects using post processing component and i can confirm you it works well :slight_smile:

Absolut alternative is to make a actor with those components, spawn it in C++ and just control it

Also as extra if you want to add level specific properties, there AWorldSettings if you don’t know yet ;]

Thank-you for the answer. Althought your solution seems to work, I’ve decided to use Level Streaming to solve my problem.

The persistent level has all the common actors and behaviors for all levels (sky, fog, sicles, etc.), the ALevelScriptActor sets the streamed levels common behavior

PS: Sorry for the bad english.