New to networking so forgive me if stupid… But i have a movement script that used speed variables, and my plan is to make these variables change in void Start() depending on what upgrade that player has upon match start. Now to do this i need the use of if(isLocalPlayer), which requires Networkbeahvious. Should i use Networkbehaviour or instead write a different script that uses networkbehaviour and updates all the stats for the player from that script ?
I appreciate any help.
NetworkBehaviour is virtually the same as MonoBehaviour, just with added pieces for UNET Networking. You can see all of the variables, functions, delegates, etc by viewing their respective Scripting Refrence pages, (NetworkBehaviour & MonoBehaviour).
The biggest drawback I’ve found to using NetworkBehaviour over MonoBehaviour is that NetworkBehaviour requires a ‘Network Identity’ component on the game object. For example, if you have a script that uses NetworkBehaviour and attach it to a game object you’ll notice that the ‘Network Identity’ component gets automatically attached to the game object. This Network Identity will automatically set the game object to disabled when you start your scene, and it will only enable when a game is hosted / joined, or a script manually activates it.
Towards your question, I would use NetworkBehaviour on the script that controls your movement, that way you don’t need to reference multiple scripts.