Cast to gamemmode always fails for client

Hi!

Allright let me tell you what im doing:

  1. start a session
  2. join session with second instance of packaged game
  3. start game with a servertravel (to a map that has a different gamemmode if that matters for this case)
  4. in the gamemmode (MyGamemmode is set to default in the level that is being loaded) at begin play going through authority switch so only server does the stuff.

I “get player controller” cast to specific controller bp (that is default for the gamemmode that is the world override for the map so it should be loaded for all)
Then I call an event that is in said player controller. The event (running “on owning client”) sets up the ingame UI (wich correctly works everytime) and then I cast to the specific gamemmode (MyGamemmode, the one where this event got called from) but the cast to gamemmode always fails.

Here in pictures:

removed: was not helpful or could be misleading

GameMode is a server-only object. It is not replicated. I suggest you look into GameState instead.

yessss ty.

i just deleted the whole “cast” and call the respawn event in the gamemmode itself

no that was not the problem, problem was that clients can not cast to gamemmode

and btw creating a session can (now) be done per node

Yes in a multi player game only one GameMode exists and runs on the server ,
GameState can be used instead. This video also explains GameInstance :

You should just do it all in one project with multiple levels. You can load levels via blueprints.
Regards: VIPMAY