How to count score on all players from non player object
Hello,
I've been trying to make a rocket league type game with unity 5.4 and in c#.
I've got everything with the players working and the playarea. The players are spawned by the network spawner and a ball is spawned by a ball spawner, like the enemyspawner in the tutorials. I have two goals that the ball can collide with and that resets the ball position. But how do I tell the players that there has been a goal? I've been looking everywhere and can't find a good exampel of how to pass information to the players from the ball. I have a text UI that shows on all players camera and that uses 2 variablers that count score, so what I want is to somehow increase those variables via the ball when it collides with goal.
RPC calls only work between player objects as I understand it, and syncvars does not seem to work if I try to have them between the ball and the players, anyone have any tips or can tell me what I'm missing?
Your answer
![](https://koobas.hobune.stream/wayback/20220612090937im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
What's wrong with my script ? 0 Answers
Using syncVar in networkManager 1 Answer
Command function called on server 0 Answers
What does this error mean? 1 Answer
How to disbale a network start position on runtime 0 Answers