I guess you set the Pawn to be replicated, so destroying must be done on the Server. Client’s will only destroy their own local version, since they have no Authority.
If the Server destroys it, it will be destroyed on all Clients. I don’t know where you want to do this. Maybe at the point where the Pawn gets less or equal than 0 health?
But yeah “Destroy Actor” is the way to go.
Then, the GAMEMODE only exists on the Server. You can’t get it on Clients and you can’t call stuff on it from Clients.
So you DON’T need a Server RPC for it. I mean the “RESPAWN” function can be a normal event.
Your “RequestGMRespawn” is already a Server RPC, so you are already on the Server. No need to do another Server RPC.
And: Why are you casting “Self” to its own class? Remove the Cast that has the Warning. The warning should already tell you
that the cast node makes no sense.
The rest should work. Are you sure the Pawn is getting spawned at all? Print Strings and Breakpoints can help to check if stuff
is called at all.
Well I’ve made it without the tutorial because an didn’t want to watch 50 minutes I tried by myself…
The result:
Before you let the character respawn destory the old actor.
: