How to do more upon tank death in Battletank?

Hi everyone,

I’m trying to figure out a way to add some different functionality to the tank death/switch to spectator mode shown in the course. My goal was to wait a few seconds on tank death (or after a mouse click/button press) and move to a mission failed screen.

I’m having trouble figuring out a way to get notice of the tank death in Blueprints, so I can move to the failed screen. For example, making the OnPlayerTankDeath() accessible in Blueprints has gone nowhere for me. Anyone have some examples of doing something more than just going to spectate mode in Battletank?

Well, I attempted to figure out something that would work here. Best thing I came up with was to make the delegate in the Tank.h blueprint assignable:

UPROPERTY(BlueprintAssignable, Category = State)
FTankDelegate TankDeath;

Then, it was easiest to ditch the player state spawnpoint, and just place my player Tank_BP in the level and set the “Auto Possess Player” property. Then, all I had to do was go right click on the tank and Add Event “Tank Death.” Then in the level BP I could do this:

Is this the right way? IDK. I’m sure there is some way to preserve the player start spawn for your tank and still do this, but I couldn’t figure it out.

Privacy & Terms