The observed monobehaviour XXX of this PhotonView does not implement OnPhotonSerializeView()!

so no idea why im getting this error
sorry for the bold just trying to split code and reg typing
The observed monobehaviour (FredPS(Clone)) of this PhotonView does not implement OnPhotonSerializeView()!
UnityEngine.Debug:LogError(Object)
PhotonView:ExecuteComponentOnSerialize(Component, PhotonStream, PhotonMessageInfo) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonView.cs:515)
PhotonView:SerializeComponent(Component, PhotonStream, PhotonMessageInfo) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonView.cs:434)
PhotonView:SerializeView(PhotonStream, PhotonMessageInfo) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonView.cs:327)
NetworkingPeer:OnSerializeWrite(PhotonView) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:3493)
NetworkingPeer:RunViewUpdate() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:3414)
PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:132)

its not even calling a script. just the base game object
so im quite confused

i use the following
void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
{
if (stream.isWriting)
{

stream.SendNext(health);
}
else
{

health = (float)stream.ReceiveNext();
}
}
is all im sending at the moment

but yet i still get this error i fires this error 3 times and because of this i cant seem to update my health values





[PunRPC]
public void GetShot(float damage)
{
health -= damage;
if (healthless "lessthan" = 0 && photonView.isMine)
{
if (RespawnPlayer != null)
RespawnPlayer(3f);

PhotonNetwork.Destroy(gameObject);
}
}


ii call the punrpc within this

void TempShooting()
{



RaycastHit hit;

if (Physics.Raycast(firePos.transform.position, firePos.transform.forward, out hit, Mathf.Infinity))
{

Debug.DrawRay(firePos.transform.position, firePos.transform.forward, Color.red);
if (hit.transform.tag == "Player")
{
hit.transform.GetComponent().RPC("GetShot", PhotonTargets.All, GunDamage);
}




}
}

and on update i have my input for firing ...

if (photonView.isMine)
{

if (Input.GetKeyDown(fire))
{
TempShooting();
}


}

Any Help on this would be great thanks !

Comments

  • So still no idea what is causing this error every thing is working fine. except when my player spawns it throws this error
  • vadimvadim ✭✭✭
    Error message is pretty clear "The observed monobehaviour (FredPS(Clone)) of this PhotonView does not implement OnPhotonSerializeView()"
    "Observerd" means one of components in "Observer Components" list in properties of PhotonView script in inspector of prefab.
  • so i get this error when observing the photontransformview and animator components from photon? little confused cause if i dont observe them they dont work ?
  • vadimvadim ✭✭✭
    At least one of components you observe does not implement OnPhotonSerializeView.
    Components are observed by PhotonView for single purpose - to make use of OnPhotonSerializeView method to synchronize things.
  • So you don't need a photon view for RPC's? I was pretty sure you do.
Sign In or Register to comment.