Hey guys, i am creating an online tps game, but when i try instatiate the bullet it doesnt spawn?
can someone help me? heres the code:
using UnityEngine;
using System.Collections;
using Photon;
public class Shoot : Photon.MonoBehaviour {
public float WaitTime = 0.5f;
public GameObject photon;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
WaitTime -= Time.deltaTime;
if(WaitTime <= 0)
WaitTime = 0;
if(Input.GetMouseButton(0) && WaitTime == 0) {
Debug.Log("TestShoot");
WaitTime = 0.5f;
GameObject bullet = PhotonNetwork.Instantiate("OnlineBullet", transform.position, transform.rotation, 2);
}
}
}