- Home /
Question by
Heroic0 · Nov 13, 2017 at 08:00 PM ·
networkingrpcclient
Player Doesn't Exist On Client
In my paintball game, I'm trying to set the color of the player to the color of the ball they were hit with. The host can change the color of the client's player but when the client shoots the host, the host doesn't change color on the client's end, and I get an error:
"NullReferenceException: Object reference not set to an instance of an object" on the line where I change the color for the clients.
[ClientRpc]
void RpcChangeColor(GameObject obj, Color color)
{
obj.GetComponent<Renderer>().material.color = color; // This line has the error, obj is null
}
Here is my network manager:
capture.png
(45.1 kB)
Comment
Your answer
Follow this Question
Related Questions
Network how to send data/activate function 1 Answer
ClientRpc not called on Client 1 Answer
RPC network info not returning an IP? 0 Answers
Requesting data from server 1 Answer
NetworkManager auto deleting client gameobject when calling it 1 Answer