Search Unity

Third Party Photon Minion Syncing Across all players HELP????

Discussion in 'Multiplayer' started by JoeeyIreland, Apr 16, 2014.

  1. JoeeyIreland

    JoeeyIreland

    Joined:
    Jan 23, 2013
    Posts:
    39
    I am currently making a MOBA(Dota2,League of Legends) style game and i am having one problem with getting my minions to be synced will all the clients that connect. At the minute my minions are spawning at the first waypoint i have set for their path to go down here is where i am telling them to instantiate

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class SpawnMinionsA : Photon.MonoBehaviour
    5. {
    6.     public Transform node1;
    7.     public GameObject MinionPrefab;
    8.     public AudioClip MinionSpawnSound;
    9.    
    10.     // Use this for initialization
    11.     public void Start ()
    12.     {
    13.         StartCoroutine (spawnMinion ());
    14.         audio.PlayOneShot(MinionSpawnSound);
    15.     }
    16.  
    17.  
    18.    
    19.     // Update is called once per frame
    20.     void Update ()
    21.     {
    22.  
    23.     }
    24.  
    25.     IEnumerator spawnMinion()
    26.     {
    27.         for (float x = 1; x < 8; x++)
    28.         {
    29.             yield return new WaitForSeconds(0.9F);
    30.             GameObject Minion = (GameObject)PhotonNetwork.Instantiate("MinionA",node1.transform.position,node1.transform.rotation,0);
    31.  
    32.             if(x == 7)
    33.             {
    34.                 yield return new WaitForSeconds(25);
    35.                 x -= 8;
    36.             }
    37.         }
    38.     }
    39. }
    this is basically saying that they will instantiate and spawn and that function will repeat itself and spawn them every 25 seconds. but they are in different position on every players client. I have put PhotonViews on the minion prefab and the spawn point

    hopefully someone can help me i need to solving ASAP
    Thank You