I am creating a multiplayer shooter in space with spaceships. When the player possesses the spaceship, he should have the controls to that spaceship. Currently, on the server it works just fine, but on clients, the player cannot move, he can only enter and exit the ship and, after exiting, the player cannot move anymore. Please help. Below is the code for the player to spaceship possession.
Possession should happen in the game mode. And the server should be the one determining if it can happen in the first place. Also just to note your Is Occupied bool isn’t replicated. Because of that multiple players could occupy the same vehicle. Also, the movement component of the player pawn should be set to none after you disable its collision. Especially if you’re using the character movement component.
Projects that I develop that have vehicles, other pawns I can possess, I code the inputs directly into the pawn class vs multiple IMC’s that get toggled in the controller. Regardless, you should be disabling IMC and reloading it as needed.
When the GM Possesses a pawn I call Autonomous Possess on the client. That loads the Enhanced Input and mappings for that specific pawn. Pre-Unpossess I call Autonomous UnPossess on the client.
Thank you so much, that work great and solved the problems.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.