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
I’m not sure i understand your question, can you elaborate?
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.
Agreed, not sure I understand this question. What are you trying to do? It doesn’t look like you are trying to create a “timer” at all. But a widget with some other functionality. What exactly is meant by “when it leaves the view port it will hit the spot you click on”?
So it’s like a normal battleship game, you choose a spot and that spot will be blown up or just be gone. I want to make a question in between, so if you get it right, it’ll blow up but if you get it wrong, it’ll skip your turn pretty much. The widget will come up on the screen when you click the spot you want to blow up, like how you do in the battleship game. I then want it to be on the screen and when it leaves, the spot will blow up or it will skip to the next player’s turn. I can’t figure out how the widget will be able to do this.
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.