Hi!
Question is:
I put some logic and variable in object class.
I made a sof refence of it.
I loaded it in the blueprint.
Change some varible in it.
If I unload this object, will it be the same or it will be new one?
I think it always gets back to default variable value. One that you set in editor details as default.
You think?)
I know when you have dynamically loaded actors on level that is streamed. When you go out of range of such actor it gets unloaded, and when you back actor has default state.
Really annoying when you make open world RPG when random objects get reset to default state. Like chests, puzzles, doors, all get reset when player walks out of range and returns.
So probably will happen with soft references when actor is unloaded and loaded back.
You could have an overarching class to hold the states of streamed objects via structs. This could also be used to in conjunction with savegames to save / load the world state.
Not sure if a map of guid => state struct would be enough. Are guids constant when it comes to streamed assets? (I need to start experimenting with this).
Rama had save system in his plugin with streaming volumes if I remember correctly.
A bit of an older video but the underlying tech could probably be spliced in with streaming delegates.
Yup, i know how to solve that problem, it is just annoying (could be automatic just some option to check next to variable, to be saved and stored when actor is unloaded).
event EndPlay is best for doing such system, that and GameMode or GameState and that can be easily coded.