i wrote this code to make my plane fire bullet but it doesn’t work…
using UnityEngine;
using System.Collections;
public class shoot : MonoBehaviour {
public GameObject bulletPrefab;
public float speed=5;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if(Input.GetButtonDown("Junp"))
{
Instantiate(bulletPrefab,transform.position,transform.rotation);
transform.Translate(speed*Time.deltaTime,0,0);
}
}
}