Hi,
I’ve been studying Unreals Network documentation for a last month, I found this Compendium (Multiplayer Network Compendium | An Unreal Engine Blog by Cedric Neukirchen) and I’ve read many forum posts but still I can’t create a working Vehicle System for Multiplayer Server-listener, Online Subsystem Steam type game.
Here is my way of doing it:
- Spawn 4 “VehicleBlueprint” Pawns in GameMode and collect all of them in array variable.
- Add a box to the default “VehicleBlueprint”, use oncomponentbeginoverlap and oncomponentendoverlap to make sure that Player is in correct spot to enter vehicle.
- In PlayerController add InputAction (Press “e”).
- Cast from VehicleBlueprint to PlayerController and send there owner (Actor) of Overlapped Component (It will be one of four spawned VehicleBlueprint)
- Sinse I can’t Possess Actor, create Custom Event in PlayerController called “CheckVehicle”. ForEachLoopWithBreak will match Actors/Pawns names with array form GameMode and then set result as a ‘‘CurrentPawn’’
- By using “Has Authority”
on Authority using FlipFlop:
* I will destory current pawn and possess one of spawned “VehicleBlueprint”
* “Spawn Actor From Class” (Transform next to just owned VehicleBlueprint) and possess default pawn (ThirdPersonCharacter)
on **Remote**
* **RPC** and the same as above
Server side is working, but client never gets correct pawn to possess
What am I doing wrong? Pls help