When I try to possess a Pawn in Multiplayer as a client it crashes. I’m using the First Person Template.
When I hit a trigger box next to a pawn, I’m supposed to possess it. It does this and works in single player, and in multiplayer as the server. But crashes when a client attempts to possess it.
Already have the pawn movements setup (Authority only)
Game only crashes when a client tries to possess pawn. But not when server does.
You need to make an event that’s set to Run on Server and pass your player controller as a variable when you call it from the client. In the server event code do the possession using the controller you passed to the event.
I’m new to UE 5.4.4, self-studying during 1 month. I’m struggling to make my player B_Hero_ShooterMannequin to possess an OffroadCar_Pawn.
It works on the server and player possess and control imputs for the vehicle, but does not work in the Client. I tried to follow your instructions, but I’m probably doing something wrongly because is not working. Please check my Event Graphs:
Here is what I’ve done, just for possession. My interface sets the replicated character from the pawn you start as. Then this allows both client and server to possess my new character/vehicle. I hope this helps.
Interaction happens via the Character or Controller. Possession actions should initiate from the controller → server controller copy → Game mode.
In multiplayer only the server has a copy of the Game Mode.
A smidge more clarity.
With an interaction system the client is at most “sampling for interaction”. Player inputs to interact and checks if there’s an interaction. If so you call the server to interact.
The servers interaction results in actual action. The Server is the Authority.
It attempts interaction. If there is interaction (positive hit), it then takes the proper action. Spawning/Destroying something, adding/removing inventory, opening a door, toggling a switch, possessing a different pawn etc.
With possession the servers action would be to call a possession event in the GM and Pass an actor reference for what you want to possess and a reference to the controller that is possessing.