Killemall game mode

I was following the tutorial of how to make a killemall game mode, but it end up showing that PawnKilled is not a member of gamemodbase

Did you add to the cpp file too?

yes

It is because the base class doesn’t know about your method so you can’t call super.

what should I do to fix it? i did try to add override after virtual void PawnKilled(APawn* PawnKilled) but its not working and having more errors after i add it, and I did change super to AGameModeBase, but its not working as well

Ok, for override to work the base class (as in AGameModeBase) must also define your method which of course it does not and also in the base class it would also have to be a virtual. Not everything can be overridden. To call Super::PawnKilled, the same logic applies. The method does not exist in AGameModeBase so when you try to call it, the compile fails. This is the fundamentals of C++ and Object Oriented Programming.

The error reads 'PawnKilled' is not a member of 'AGameModeBase' because…wait for it…it only exists in AKillAll.

Simply delete the call to Super::PawnKilled because it cannot succeed because AGameModeBase::PawnKilled does not exist.

its compiled now, tysm prof bee!

1 Like

Privacy & Terms