I've been looking around for some advice on how to implement multi-crew vehicles in multiplayer within Unity. Basically vehicles that exist as their own entity and players can hop in and out of positions on the vehicle to drive/shoot/etc. The advice I've found so far is very thin on the ground, vague, very outdated or refers to something in the assetstore ( that may or may not still exist ).
I've run pretty solidly up against the limits of my understanding of Unity multiplayer.
I've put together a reasonably functional implementation in singleplayer but I have no idea how to convert that into something that works within the constraints of multiplayer. For example, this is the current setup that I have:
Player(PlayerControllerScript)
Vehicle(VehicleControllerScript)
Driver(DriverScript)(TriggerCollider)
Gunner(GunnerScript)(TriggerCollider)
When the player hits a key when inside the trigger area of the driver/gunner the Player object becomes a child of the Driver/Gunner and is disabled, the driver script then takes over processing input from the player.
Vehicle(VehicleControllerScript)
Driver(DriverScript)(TriggerCollider)
Player(PlayerControllerScript)
Gunner(GunnerScript)(TriggerCollider)
This works great in singleplayer but I have no idea how to pass input from the client to the server to tell it to move the player around. Am I at all on the right track or is there a much easier way of implementing this sort of thing?
Your input is much appreciated.
↧