c# - Networking Movement not working -


i making multiplayer scene dodgeball game , once have host , client running, spazzes , forces me control both host , client in 1 window. here mean:enter image description here

this code managing network:

using system.collections; using system.collections.generic; using unityengine; using unityengine.networking; public class script4network : networkbehaviour {  // use initialization void start() {  }  void update() {     if (!islocalplayer)     {        return;      } } } 

it might have lack of understanding localauthority.

you should use islocalplayer in update

// update called once per frame void update() {     if (!islocalplayer)     {       return;     }      if(lives == 0)     {         scenemanager.loadscene("lose");      }        livestext.text = "lives: " + lives; } 

Comments