Search in

Sort by:

Everything Blueprint Scripting

Current Space

Question Status:

All Questions With Answer With Accepted Answer

Quick results

Search help

Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both.
Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.

You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with
each other. Examples

Game Mode Winning Conditions

I've got a blueprint for the coins set up so you can collect them and the timer counting up at level start. The problem is that I don't know how to go about tracking how many coins are in the level and capturing the time when the last coin is touched to display on the scoreboard.

You can use "Get all Actors of Class" and choose the Coin Class. This will return an array of all coins. You could check the Length of the Array every tick (or maybe everytime a coin was picked up) and if the Length is 0, the player collected all coins. All of this works providing that you delete the Coin Actor if it gets picked up.

Yeah, for sure, he could either have an Int Variable set by hand (like 10 coints) and substract everytime he finds a coin, or let the Variable be set by the "Get all Actors of Class" on Begin Play, so he could have different amounts of Coins. (Still letting the Coin Pick Up function reduce the Variable).

Then he would need to check the Int Variable and if this get's 0, the game would be finished.

Thanks guys! Actually I'm going to try to get it to work using eXi's suggestion as I want to be able to have a different number of coins with every level as the game's difficulty increases. I'll post back here once I've made some progress.

Now I just need to figure out how I can take what the current time is from my timer and print that to the screen along with the "You Win" text. I'm going to look at the Time Attack tutorial Epic posted to see if I can figure this out.
https://www.youtube.com/playlist?list=PLZlv_N0_O1gZAjYuGIwtOHigppYa3CVLh
When I do I'll create a tutorial on how to do the entire thing.

Hi, I've tried to follow this solution but I just don't seem to be able to hook it into my blueprint correctly. I've got a function to count items, destroy them on overlap and display the number in HUD. The game has a timer which ends the game on 00:00 and is again displayed in HUD. What I can't figure out is where to connect the logic that says when all actors of the acorn class have been destroyed end game. I've tried plugging the BP abov into the game mode but the event tick is already driving the timer the event begin play is driving the HUD. I tried plugging it into the Acorn BP before and after the actor is destroyed but it still doesn't work. Any help is much appreciated. Andy

Ok so I'm guessing that your dash dog bp is your player character?
Always add a print string to the end of the Cast Failed to make sure it's succeeding but in your case your get all actors of class isn't connected to anything. Just plug the pin from Destroy actor into Get all actors of class and it should work. Also, You want to quit the game when the player wins? That might be a bit harsh but I'm guessing it's just for testing purposes?

Sorry for delayed response I've been working on other parts and didn't see the update. Your advice worked great thank you. Yes quit game is just for test as win screen and main menu is yet to be built. Thanks again, Andy