ToonTanks countdown timer

Hi!
I really wish we could reply to old topics, but oh well. I guess that would bring other issues as well.
Anyway, this in relation to this one: Unreal 5.0 C++ Developer course, toon tanks game, countdown

Just wanted to add that there’s the handy Get Timer Remaining Time by Handle node. So, I avoided making two separate timers by exposing the timer handle to Blueprints like so, in ToonTanksGameMode.h:

	// Timer handle for the 3-second countdown
	UPROPERTY(BlueprintReadOnly)
	FTimerHandle playerEnableTimerHandle;

and then getting it and using it in Blueprints like so:

Just figured I’d post it, in case anyone else has the same thought!

Edit: there’s a quirk here, where the return value jumps directly from 0 to -1. This means that the output from ceil will never be 0. SO an amendment has to be made in the Switch statement for “Go!” to be displayed. I did it like this:


The start index can be changed in the Details panel of the Switch node.

Kind regards,
Håkan

1 Like

My version, I tried to pass the FTimerHandle as an argument to StartGame but it wasn’t working. Not sure why. I also replaced that switch type logic with a map.


image

I think the other method of being passed in to the event was that I was doing a struct by val which presumably means a copy…

Privacy & Terms