- Home /
Still getting BroadcastMessage has no receiver error.
Hello, I have 2 scenes, 1 for client and 1 for server. In my client scene I have script attached on Network manager and in my server scene too. I want to do, that when minPlayers is connected to server, it will start countdown. I have tried to use manager.BroadcastMessager method, but I am getting no receiver error. My server script:
private bool countdownStarted = false;
public int countdown = 10;
void Update()
{
if(manager.numPlayers >= manager.minPlayers)
{
if(!countdownStarted)
{
countdownStarted = true;
while(countdown >= 0)
{
manager.BroadcastMessage("Game starts in " + countdown);
countdown--;
}
}
}
}
Thank you.
Answer by Norfinity · Sep 09, 2016 at 10:33 AM
Hi, what you actually calling is the BroadcastMessage of GameObject: http://docs.unity3d.com/ScriptReference/GameObject.BroadcastMessage.html, what you looking for is sending a ClientRpc, have a look at this: https://docs.unity3d.com/Manual/UNetActions.html. Hope it helps
Your answer
Follow this Question
Related Questions
BroadcastMessage between children? 3 Answers
CHAT Multiplayer Problem 1 Answer
HLAPI: Can't connect to Server via Broadcast on LAN 1 Answer