Need Help With Leaderboard
I am trying to add in 3 different text objects in game that show Score, Time, and Highscore. I am very new to Unreal and cannot figure it out. Basically my game will be on a 60 second timer, and your goal is to shoot the target as many times as you can in the 60 second period. After 60 seconds the timer should reset, the score should go back to 0, and the highscore should be changed to your last score if it is greater than the current highscore. I thought that maybe if I used labels, i could use variable to change the text of the labels, but have not been able to figure it out. If anyone could offer a quick and efficient way for me to add a leaderboard, it would be highly appreciated!
asked Mar 12 '15 at 03:30 AM in Using UE4
Hey there (:
First you need to choose the class where you want to save this.
I pretty good one would be the "GameState" Class. Create a new Class or BP from the GameState Base Class and go into your Maps and Modes Settings in "Project Settings". Here you can set the GameState Class you want to use (same way as you set the Character, Controller and HUD:
Then create your variables in this BP. Like float Timer, int Score and int Highscore.
Now you can set these variables like you want in any BP/Class you want by just searching for the GameState in your Event Graph:
Then cast it to your custom BP/Class and set/get the variables like you need them.
answered Mar 12 '15 at 10:16 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here