Hi guys and gals!
I’m trying to set up a ModelView + Controller pattern in a multiplayer prototype, so my player prefab is a PlayerController, which is the players only entry point to the game, so it handles all input, etc.
So when the player chooses a unit to play as it spawns, and hooks itself into the PlayerController so the player can actually control it.
That’s the theory… In practice what I have is a case where I either the unit spawns on the current client and gets connected to the controller (but doesn’t show up on the server or other clients), or the unit gets spawned on the server and the clients, but doesn’t get connected to the local player. (I’d show code, but I’d rather not muddy the waters).
How can I initiate the spawning of an object on the local client and have it perpetuate to the server and other clients?
Ideally I want to have that connection between unit and controller established on server and all clients so that we can connect the unit back to their controller and do fancy things with that, and I learned that SyncVars are not the way to go.
I apologise if my question is a bit vague, any help would be great.
Thanks!