okay so I did the work to set up a lan game through the Network manager and it’s UI. I gave it a prefab then I made an executable and that all worked but when one person moves every body’s players move.
So please post if you have fixed this problem before.
Thanks Pac
Are you using UNET? Sounds like that.
Your issue is happening because you don’t check if you are the local client while using the mouse or the keyboard (meaning, when you process the inputs). Le’ts say you have a class “ThirdPersonController” in which you process the input in the Update() method, to solve your problem you just need to add this line at the very top of the Update():
If (isLocalPlayer) {
//Then process inputs
}
or
if (!isLocalPlayer) return;
Of course in case you are using UNET you have to derived the class from NetworkBehaviour and not from MonoBehaviour (otherwise the variable “isLocalPlayer” won’t exsists, and anyway you won’t be able to use any network property or method).
If you are using some other technology you just need to figure out how to check if it’s the local client giving the inputs (it should look similar anyway).
Understand that with the Unet HLAPI all code on your spawned GameObjects runs on every computer connected to the game, unless you specifically tell it not to. If you have code you only want to run on the server, you need to check first that this is the server. If you have code that only should run on a specific client, you have to check for that too like in this case.
That’s okay Eleventh wolf most likely solve the problem. I am going to try this evening.
Okay I tried it out and it works now.
Thank you Eleventh wolf.
Pac