Items disappearing on level load as if owner not set (UE4)

HuntaKiller
Sun, 02 Jul 2023 16:53:41 +0000
Programming & Scripting

Hello all, I’m observing unexpected behaviour when dealing with unloading 1 level and moving to another.

Owner can be set after an actor is created, but it seems as if the level streaming does not observe changes to the owner after the actor has been created.

I have a persistent level and a streaming level the player starts in. Items are spawned for the player in the streaming level such that if you go to a specific location, the first streaming level is unloaded and the next one is loaded, and all all the items in the previous level will despawn appropriately.

The issue is that even after the player picks up the item (and a call is made to set the owner to the player) the item disappears when the streaming level it spawned from is unloaded. Even if I set the owner to null, the item is still unloaded (if you spawn an actor with no owner it never depawns). To me this indicates the level seems to cache the owner and fail to observe updates. I’m doing this all with BP currently.

Am I missing something? How do I get the behaviour I am looking for, where items not picked up would unload and items picked up would continue to exist.

Appreciate any help.

5 posts - 2 participants