I have a problem with World Partition, if I destroy an actor from the level, it respawn each time the grid is reloaded. What is for you the best solution to permanently destroy an actor (loaded with WP) at runtime?
Would need not to be part of the level - or you need to save its dead value and just destroyactor on Begin Play.
Note: definitely a horrible way to do it. Just move it to persistent instead.
No reason to keep a dead value in memory for things that are gone.
Spatially loaded actors don’t persist any data changes between unloads and loads, so you either have to make anything that you want to destroy not be spatially loaded (which you probably don’t want to do for performance reasons) or you need to have some sort of persistent manager object that can keep a list of destroyed actors and have the actor look up if it’s on the list when it loads and destroy itself if it is (use the Actor GUID for the list, not a reference to the Actor itself, as the Actor reference is unique each time it streams in, whereas the GUID is persistent).
Thanks for your answers, it confirms what I thought.
Performance is probably irrelevant here.
When things are a core mechanic you don’t give a toss about what the cost is.
Within reason ofc, you know. You shouldn’t waste 30 seconds on loading a single asset for instance.
Still, people will put up with it if you do it as a Loading option.
Best example I can give is dynamically editing Foliage, manually saving it, and re-loading it any time you reload the level.
Its expensive. It’s intense (billions of instances to store/read/write), but just about every game does if one way or another…