Saving & Loading only the coins that haven't been picked up?

Hey peeps!

I have a level with a few coin pickups. When I save, and then load, the coins are still there!
Everything else works, just the coins are still being spawned.

So, I took to the youtubes, and found a few suggestions where they say to save a ID and Bool the indicates if the coin has been picked up, then have the object check the bool, and destroy itself.

This works, BUT…

Is this really a good way of doing it? Why load the coins, just to destroy them? There must be a better way, yes? Is there a “Pre Actor Spawn” event where I can check the bool before the level places it into the world? Is there a “Spawn Queue” that I can edit and remove the actors I don’t want in the world anymore?

I can also manually spawn it into the level, but is this the only alternative to the above solution where I spawn and then destroy?

Any solutions welcome; Blueprint or C++.

Thanks!

This is how it’s done, I’m afraid :wink:

If you make your coins blueprints, at least they can lookup their ID on begin play, and get rid of themselves.

Yea, that’s what they do now. They look up their state on BeginPlay.

I guess this is why there are loading screens right ? lol

Thanks for the quick reply!

1 Like

If you make the default ‘not visible’, then only the remaining coins will appear :slight_smile:

1 Like