Character movement jittery on Client

The GM needs to handle Spawning characters and the possession of them. This is the proper place, regardless the ability to do it elsewhere.

The way I handle this is to have a basic character set as the GM’s Default Pawn. The GM will spawn this character as soon as you connect to the server.

image

The GM only exists on the server in a packaged product. This means any communication between you and the GM has to go through the Controller class.

Set a Game Mode reference in the controller class via the GM’s OnPostLogin Event. This will only set it on the Servers copy of the controller.

From here you need an event in the Controller class (Run on Server, Reliable). And an event in the Game Mode to handle swapping the default out with the new choice character.

Call the controller event once selection is done. Pass any arguments/params to the GM event as needed. My reccomendation here is to use a struct that only contains simple types (int, string, name, enum, bool). No references to Objects or Classes.

It’s better to pass a name type for a data table look up vs fully referencing a class/obj.

The GM’s event will call a function to handle the work.

2 Likes