How do I make a widget into a timer?
I'm trying to make a battleship game and I want a widget to act as a timer, meaning that while its in the view port, nothing will happen but when it leaves the view port, It will hit the spot you clicked on.
This is the widget that I'm using. this is the blueprint I'm using, which makes sense to me but it's not working how I think I have it set up. Please Help me ASAP
asked Apr 27 '18 at 04:20 PM in Blueprint Scripting
Use timers, don't use delays they not reliable in counting time
Alternatively you can also add up Delta Seconds in Tick event.
From there you just display state of timer on the widget which is simple, you can bind text function to get timer state and display it. You can also use Timespan type for easier formating.
answered Apr 27 '18 at 06:01 PM
Ideally, the Widget will have a reference to the Blueprint that either destroys the spot or skips the player's turn (or it can have that logic itself). Then you would have two OnClick events in your widget, one for ech button, and depending on which one is the right answer, the OnClick events would either notify your other blueprint to blow up the spot or skip the player's turn.
answered Apr 30 '18 at 04:04 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here