Light.color Sync ?

i’m trying to sync Light color between player
always i got error

Exception: cannot serialize(): UnityEngine.Color

i did like this

using UnityEngine;
using System.Collections;

public class LightColorNetwork : Photon.MonoBehaviour

	public Light HeadLights;

	private Color LightColor;

	public void FixedUpdate ()
		// If we are not owner receive all inputs from server.
		if (!photonView.isMine)

			HeadLights.color = LightColor;

	private void OnPhotonSerializeView (PhotonStream stream, PhotonMessageInfo info)
		// Sending all inputs to server.
		if (stream.isWriting)
			LightColor = (Color)stream.ReceiveNext();

			updateTime = Time.time;

Thanks in advance for any help!


in order to synchronize a Color type you either have to send each single RGBA value as float or have to register a Custom Type. To see how this works I would recommend you taking a look at the Serialization in Photon documentation pages which contains an easy to understand example of how Vector2 is serialized by PUN. You can adjust this for Color types.