- Home /
Question by
zak666 · Jul 24, 2015 at 10:42 AM ·
scripting problem
Network Instantiate WITHOUT inspector?
is it possible to create a network instantiation WITHOUT the inspector. Have AI controlled fighters being Instantiated with carriers so Fighter Bullets cannot be dragged into the inspector as normaly you would do for instantiating over a network. everyone keeps telling me how to do this threw the inspector when it needs to be done oputside the inspector bsicen unity dose not alow you to do this
using UnityEngine; using System.Collections;
public class AI_MachGunsFire : MonoBehaviour {
public float NextFire =0.0f;
public float MachineGunFireRate = 40;
public float GunsActivate = 1;
public GameObject MachGuns;
public void Update () {
if(enemeyfighterrange.IsFireing > GunsActivate){
NextFire = Time.time + MachineGunFireRate; //fire rate...
MachGuns = PhotonNetwork.Instantiate(Resources.Load("MachineGuns")); //instantsiate gunfire over network...
//fire machine gund when in range of User, at short burst...
}
} // end of update....
} // end of class....
Comment