- Home /
UNet - RPCs from NPCs won't work
Everytime I send an RPC from Server to Clients through a NPC I get this (along with it not working and the game stuttering)
Exactly when sending ONE single RPC
[ClientRpc]
public void RpcSendHealth(int hp)
{
health = hp;
}
and just calling
if (isServer)
RpcSendHealth(health);
upon taking damage.
I then noticed this only happens when the Rpc is situated in the Parent Class, using ONLY the Parent Class it works just fine.
Any ideas? This is really annoying, I need to send information to players and this won't let me. I have a BasicAI class which contains the Rpcs and is inherited by other classes.
It doesn't work. I also forgot to add it stutters when that happens.
Nothing important, registering a list of prefabs but forgot to add NetworkIdentity to 2 of them.
Anyone anything to suggest? D: I figured something out, apparently this ONLY happens when the RPC is being called on a parent class. If I include the parent class to my NPC this ceases to happen.
Your answer
Follow this Question
Related Questions
How to fix "ClientRpc call on un-spawned object" error, using UNET 2 Answers
UNET Make every player execute a function locally 1 Answer
Issue with synchronizing NPC Health over the network. 1 Answer
[UNET] Calling a function on a specific Client 2 Answers
Rpc is received by client but Cmd is not received by server 2 Answers