Five days I’ve been trying to make a simple connection between two players, to spawn them and let them walk around the map. Well, the connection and the spawning thing works, but something else fails:
Here’s what happens:
1 - Server starts - the server’s player can walk around and it works great
2 - client connects
3 - server loses control over his player and whatever he does, he can’t move it
4 - when client moves, he moves the server’s player too.
I tought it’s because of the player script, but it seems the problem is somewhere else (the project maybe). I opened M2H’s networking project and started the Authoritative server example and it worked great, then I decided to just copy the spawner and the player scripts from the tutorial into my project and scene and when I used them the same problem occured, that I had with my player.
Now, I wrote a topic for that before, but nobody managed to help me, so now I’ll make it more informative by supplying pictures and the spawner and player scripts. I tried to copy everything from M2H’s example to my project (the game objects’ components, their settings and everything) and still didn’t work.
So I have a spawner object, which looks like this:
And a player prefab with some children, that looks like this:
Run in Background is set from the project options.
I’m attatching the scripts below, please help me fix this problem, I can’t get this to work since wednesday
436285–15169–$Player.js (5.6 KB)
436285–15170–$Spawner.js (650 Bytes)