sync values when neutrals attack eachother

None of my gameobjects are controlled by the player. "IsMine" never returns true. How do i sync variables when i don't seem to be able to use isWriting and isReading?
I looked for tutorials to sync health and they all use OnPhotonSerializeView which clearly states:
"To make use of this method, the PhotonStream is essential. It will be in "writing" mode" on the client that controls a PhotonView (PhotonStream.isWriting == true) and in "reading mode" on the remote clients that just receive that the controlling client sends."

Either i'm not implementing it correctly or i am unable to use it in my game due to every unit being controlled by the server. If this concept seems weird just imagine a moba game where neutral creeps are attacking eachother. None of the creeps are controlled by a player. My guess is that i'm simply not implementing it correctly because my transform/rotation is updated correctly on the same object (this object, of course, being controlled by nobody.) In photon view on the object i have the photontransformview (which syncs) and my health script (which doesn't sync.) Here is my health script
using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class Health : Photon.MonoBehaviour {

	public float maxHP;
	public float currentHP;
	public Image healthBar;

	void Start () {
		maxHP = 100f;
		currentHP = maxHP;
	//called by the person attacking it of course
	public void TakeDamage (int damageTaken, GameObject player) {
		currentHP = currentHP - damageTaken;
		healthBar.fillAmount = currentHP / maxHP;

	public void OnPhotonSerializeView (PhotonStream stream, PhotonMessageInfo info) {
		if (stream.isWriting) {
			stream.SendNext (currentHP);
		} else if (stream.isReading) {
			currentHP = (float)stream.ReceiveNext ();


  • I got it working, i found tutorials on PunRPC. Here is my code.

    My unit commands code:
    public void Attack (RaycastHit hit) { target = hit; isAttacking = true; if (Vector3.Distance (hit.transform.position, transform.position) <= attackRange) { agent.destination = transform.position; if (readyToAttack == true) { hit.transform.GetComponent<Health> ().photonView.RPC("TakeDamage", PhotonTargets.All, damage); Debug.Log ("attack function working"); lastAttack = Time.time; readyToAttack = false; } } if (Vector3.Distance (hit.transform.position, transform.position) > attackRange) { agent.destination = hit.transform.position; if (Vector3.Distance (hit.transform.position, transform.position) <= attackRange) { Debug.Log ("moved into range and hit?"); agent.destination = transform.position; } } }

    my health code:
    [PunRPC] public void TakeDamage (int damageTaken) { currentHP - damageTaken; healthBar.fillAmount = currentHP / maxHP; Destroy (gameObject); }