Adding spatially loaded actors to array?

Hello!
I’m using world partition and I have trees in my level that are spatially loaded actors. I want to make an array that has a reference of every tree in the level. When using “get all actor of class” and doing a for each loop that adds every element to the array, I get a crash and null pointer exception. How can I store a reference of every tree without them having to be loaded by world partition?
The purpose would be to save the trees that have been harvested by the player in a game save file, so they do not respawn and stay destroyed.

I solved the problem by adding all the object names of the harvested trees to an array inside my game instance and then saving it in a save game file. When loading the save game I add the saved array to my Game Instance again from where I can access it in my Tree Blueprints and check if that tree has been harvested and is in this saved array, if true → destroy actor.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.