okay so this is my first game in unreal engine and it’s a first person shooter, target practice, paintball game (not my idea -_-). The idea is to run around the map shooting targets. there’s a timer involved to see how fast the player can do this is in. But what i would like to find out is how to make a timer, that deducts time every time you shoot a target. i.e. takes 2 seconds off the timer whenever you shoot down a target.
This is fairly simple to do.
Firstly you will want to setup 2 floats in your game mode for “Minutes” and “Seconds”. We also want to add a ‘Timer’ node which calls an custom function “update timer” which you can call to fire at the intervals your timer will be set at (For example, 1 second). Each time it is fired, it will add ‘1’ to the seconds timer. If the seconds timer reaches ‘59’>= it will then be reset back to 0, and your minutes float will be set to +1.
As for removing X seconds each time a target is hit, all you will then need to do would be fire a function/event that removes X number from seconds/minutes, and it should all work accordingly.
This is how I have set it up in the past: