Possible bug in how editor handles manually assigned variables

Hi

I think I may have found a fairly obscure bug in way that editor handles manually assigned variables in inherited classes;

I have two levelscript actors, one for persistent level and one for sub-level (streaming level). streaming levelscript actor inherits from persistent level. I have a reference to skydome, in persistent level, which is manually assigned in editor. As soon as a sub-level is loaded, reference is invalidated. Is this expected behavior?

Thanks!

EDIT: eXi realized that variable also needs to be set by hand in sub-level. It is being set to NULL whenever sub-level loads. However, variable can’t be manually set in sub-level. And it isnt inheriting manually assigned variable from it’s parent…

Hi robbiecooper,

I don’t believe there’s any special handling in streaming levels for this. Can you detail your process/code for creating your sub-level? Thanks!

I just made a custom persistent levelscriptactor, by adding code to project and inheriting from levelscriptactor. Did same for streaming level, but inheriting from persistent level. However, since there’s only one skydome and only one directional light component per persistent level, I’ve changed it so that it uses actor iterator in each case to assign objects to references on begin play.

I was just thinking though- if you wanted to manually assign variables with inherited classes… I guess it is a bit obscure…

Hi robbiecooper,

If you’re setting variable manually in Level Blueprint for your Persistent Level (which was reparented to your LevelScriptActor, I assume?), you’re only setting value for that instance of your LevelScriptActor, rather than value for class itself. In that case, child of LevelScriptActor will not inherit that value because it is a child of class and not instance. This is expected behavior.

As you’ve discovered, doing an actor iterator on Begin Play for your LevelScriptActor child to find BP_Sky_Dome is how you would need to set this up. You can do this in code for LevelScriptActor, in which case child would inherit function, or you could do it simply in Level Blueprint for sub-level.

Hope that helps! Let me know if you have any other questions.