Difference betwen New Editor Wiw and Load Level


I have a level where i in the level blueprint assigns a camera actor in the scene as the view target.
This camera then moves and rotates on every tick to focus on an actor, also assigned in the levelBP, which it does nicely when i open it in PIE.

Hovever if i open the level via BP, or as a standalone game, the camera moves waaay out of the scene, as if it now doesn’t have any target to focus on.
I also have some characters with some individual variables set, which works in PIE, but also is reset in Standalone/Open level.

Any ideas on what the difference of PIE and Standalone Game/Open Level might be that causes this?

Cheers :slight_smile:

It’s likely trying to set the view target before that actor is loaded. Try adding a delay to debug it. If that’s the case, maybe try setting the view target once that actor is loaded.

I think it has something to do with assets still being loaded in memory with PIE so it will find them but not so in Standalone where is basically loading things fresh, so your order of operations needs to be precise.

The target actor is placed in the level by design, and not spawned or in any other way created by code.

The delay shows that the target actor is not in the level when loaded. But if i open it from the editor, the actor is where it should be?

Yes, but when playing, it might take a moment to load, the view target might be trying to be called before that actor has had a chance to load?

It has a delay of 15 secs now, and all other actors are loaded as they should, and plays as they should. Still no target actor.

is it relying on a variable to set the target? Perhaps that variable is not being set properly? If set a viable on begin play before that actor has loaded the variable will remain empty.

I ran some PrintString on both sitations, counting length of array with the actor in, and the location. In both situations, they revealed one actor at the same location, but the actor wasn’t visible on screen when loaded, and the camera wouldn’t recognize the location of the actor.
I treid to duplicate the lavel, and change the load to this, with no changes. When i changed back to the original, everything now worked as it should.
Dunno how, but it seem to wok properly now.

Thank you for the tips :slight_smile:

The problem reoccured.
I now tried to create a new level, and duplicate the assets into it, without success.
Itøs like the level doesn’t recognize any actors of that type, as when i in the level BP tried to spawn an actor from that class, without anything happening.
Problem also occurs when opening other levels with that actor.

maybe there’s something wrong with that actor. Try going to the actor’s BP, click FILE > Refresh all nodes to see if that helps. Do you get any errors or warning about this actor when trying to compile your game?

Fixed it, there was a bug / referencing problem with the BP, so deleted it, and made it from scratch. No problems now.