Light.color Sync ?

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

Exception: cannot serialize(): UnityEngine.Color
ExitGames.Client.Photon.Protocol16.Serialize

i did like this

using UnityEngine;
using System.Collections;


[RequireComponent(typeof(PhotonView))]
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)
		{
			stream.SendNext(HeadLights.color);
		}
		else
		{
			LightColor = (Color)stream.ReceiveNext();

			updateTime = Time.time;
		}
	}
}

Thanks in advance for any help!

Hi,

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.