i am kinda new to networking in unity but in the game i am working on i have a damage thing set up to where the enemies change color as they take damage. i am currently trying to make a multiplayer mode and got a lot of it working but i am having problems getting the object to change colors on the client side. the color change works on the server but thats all.
here is my code
function OnCollisionEnter(collisionInfo: Collision) {
if (collisionInfo.collider.CompareTag("bp")) {
networkView.RPC("takedamage", RPCMode.AllBuffered);
}
}
@RPC
function takedamage() {
health = health - 1.0;
gameObject.renderer.material.color.r = 0.75 + ((1.0-0.75) *((health-1.0)/mhealth));
gameObject.renderer.material.color.g = ((health-1.0)/mhealth);
gameObject.renderer.material.color.b = ((health-1.0)/mhealth);
}