Game instance lose object on "Open level"
Hello. I have inherited instance class, at game start i am creating an actor and write its reference in instance. Next i call "open level" and after that, i am lose actors reference, it becomes "not valid" and actor disappears from "world outliner".
PS Yes i am set new instance in Map&Modes.
As i read, actors would always destroyed when "Non-seamless travel". So i am little confused, because i need an incapsulated data with own methods, actors\object is pretty good for this, but i cant transfer it thru level change. And i cant use seamless travel, cause session creation.
Ok, the solution is pretty simple, you just need UObject instead of AActor. UObject doesnt belong to level and may be transfered after the level change.
I am just create BP Class inherited from UObject, take ownership to instance and save reference. After "Open level", object still "Valid"
Hello there, sorry for your misunderstanding.
Actors belong to the map. if the map is gone, they're gone too. The only single class that exists beyond maps is the game instance, everything else will cease to exists the moment their map is unloaded.
If you're using level streaming and you need your actor to cross maps, then place in the persisten level.
If you're from one persisten level to another, you can't carry over anything. You would have to fake it by storing anything relevant to that actors in the game instance and then recreating it in the new map.
Keep in mind games are all about smoke and mirrors. You're always faking stuff that from the outside just looks right.
What you keep with seamless travel are the connections to the clients. but not the actors.
answered Jan 09 '19 at 03:02 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here