Using Start Match from GameModeBase derived class

Hi

I’ve created a game mode which is derived from ‘Game Mode Base’ and I want to use the Match nodes from the parent ‘Game Mode’ class (I.e. Start Match, End Match etc). The problem is, Start Match requires a reference to a ‘Game Mode Object’ so it won’t accept a reference to ‘self’, but if I try to cast my game mode to the parent ‘Game Mode’ class it fails. So I can’t figure out how to set the target for Start Match/End Match.

Any help would be appreciated.

Thanks.

you shoyldnt have to cast to the parent to access inherited functions. try it without casting

If you want to use a function that resides in GameMode you need to inherit from GameMode instead of GameModeBase. GameModeBase doesn’t have a function called StartMatch, it belongs to GameMode like the StartMatch node describes “Target is Game Mode”. Your cast always fails because self (GameModeBase) does not inherit from GameMode.

Thank you for the answer. I think I must have been tired and not concentrating, for some reason I had it in my head that GameModeBase was derived from GameMode (despite the fact that ‘Base’ kinda gives it away lol). I think what didn’t help is I tried inheriting from GameMode and suddenly had weird spawning issues, but having read the documentation I’ve now realised I also need to change from GameStateBase to GameState which makes sense. All working now, thank you.