How to end a level, after all items in level have been collected?

Hi there, I’m rather new to UE4 and I have created a simple level where you have some coins to pick up scattered throughout the level. I would like to create a system where you have to collect all the coins in order to progress to the next level. I’ve been looking around the forums and have been seeing the function node Get All Actors of Class and think this is probably the direction I have to go, but not certain. (May even be wrong).
As of now I only have three levels a Main Map, Title Screen and Game Over screen, however I soon will be creating more levels and each one will have a random number of coins. So it is imperative that I use a system that checks to see if all coins in level have been destroyed (or collected). Any help would greatly be appreciated thanks.

Hm, this is one of these points where i don’t know WHERE to put it. You could make a variable inside your LevelScriptActor, or LevelBlueprint if you aren’t using c++. If a player collects a coin, you could run a function inside this LevelBlueprint that increments the coint counter and after that, checks if a given maximum coint value is reached. After that you could show a UMG Widget (HUD) where a button lets the player continue to the next level.

But it could be that you might place this inside the GameState, rather than the LevelBlueprint :X hmpf.but in general you just create a variable where you add 1 if the player collects a coin and a variable that you set to a maximum value. If the value is reached, you either directly open the next level, or use the UMG like i said above.

I’d have collected objects be destroyed when they are picked up. Then after the destroy call get all objects of class (as you mentioned) if it returns nothing, they are all picked up :slight_smile:

So first off thank you for the quick replies. After a bit research though, I found a solution in the Level Scripting Content example. Where I spawned all the coins in the level from the EventBeginPlay node then connected them to a Bind On Destroyed which then delegated a Custom event in which I checked to see if all coins had been collected and if so opened the new level. Still seems a little choppy, however it works for the meantime until I learn more in blueprints.

can you provide examples and screenshots?