So I have this code:
using UnityEngine;
using System.Collections;
public class scrPlayerFire : MonoBehaviour{
public GameObject bullet;
public Transform spawn;
void update(){
if(Input.GetKey (KeyCode.Space)){
Instantiate(bullet, spawn.position, spawn.rotation);
}
}
}
I made a prefab linked to bullet that has code to move it forward, and I’ve made an empty object to use for the transform.
but when i press space nothing happens. What am I doing wrong?