- Home /
Question by
Arilith · Jun 29, 2018 at 11:37 PM ·
networkingserverclient-server
Code works on server, but doesnt on Client - UNET
Hey there guys, I've got some code that just doesn't want to work correctly. When the Server executes the code, everything is fine, and the clients respond to it as well, but when the client executes the code, nothing happens, on the server nor the client.
if (isServer)
{
Debug.LogError("HENK");
RpcdoBombLogic();
}
else
{
CmddoBombLogic();
Debug.LogError("PIET");
}
[Command]
public void CmddoBombLogic()
{
Debug.LogError("JANTJE");
RpcdoBombLogic();
}
[ClientRpc]
public void RpcdoBombLogic()
{
BombMusic.Play();
Cmdtensemusic();
}
So as you can see, I added some Debug.LogErrors to test, and when I activate the code, it show's the Error with "PIET", on the client, but doesn't show the logerror with JANTJE, neither does it execute the "Bombmusic.Play();" of the clientRPC which is called in the CmddoBombLogic.
Thanks in advance for helping me, Tristan
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612165741im_/https://answers.unity.com/themes/thub/images/avi.jpg)