I’m running some C++ code that spawns some actors when BeginPlay is called. Since they’re spawned dynamically, the lighting is not baked and doesn’t look too nice. Is there a way to bake lighting when the level is loaded, like when BeginPlay is called?
I don’t believe you can bake lighting in game… But is there a reason you couldn’t put the code to spawn your items in the Construction Script instead of Begin Play? And then bake from the editor?
Light mass doesn’t get packaged in cooked builds, so there is no way to use it
Are all of your actors spawned dynamically or is there a scene that exists beforehand? If its the latter, you can bake lighting in that scene with a good density for Volumetric Lightmaps, then set your objects to use Volumetric Lightmaps only, or set the object to be Movable, and it should fit in the environment a little better.
When I tried running it from Construction Script, I saw that Construction Script was running more than once sometimes and it would leave some actors placed instead of deleting them. I’d love it if it worked from Construction Script, however, even if it was able to run from CS, it dynamically and randomly generates actors. In a game, the user wouldn’t want to have to open the editor and build the lighting every time he plays.
Yes, they are dynamic and also random, but there is no scene beforehand.
You can’t bake the lighting, also if you could it would take too long
Hmm… So is there an alternative? It wouldn’t necessarily be TERRIBLE if I can’t bake the lighting, but is there something I can do that will make the lighting look nicer?