Network Behaviour
How can my local player send data from the server ?
using UnityEngine; using System.Collections; using UnityEngine.Networking; public class Networking : NetworkBehaviour {
// Use this for initialization
void Start () {
if (isLocalPlayer) {
GetComponent<script>().enable = true;
}
}
void Update() {
[SyncVar]
score += 5;
// For example I wanna send this score to server so I can decide who will win ? //How to perform this ? }
}
I have 2 players
they can play and if the game ends . I want the scores to be send to the server so I can decide the winner.
I cant find tutorial about it please help
Your answer
Follow this Question
Related Questions
Strange (Pun2) RPC Problem. (With Error message that doesn't appear in a google search at all) 1 Answer
Game over high score script 0 Answers
Why do I get "A connection has already been set as ready." Error 1 Answer
Unity getting the score 1 Answer
Help making a high score with player prefs/displaying it 1 Answer