Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

I see another issue in your code.   You  are dealing with the wrong Time.  command. You have to change  the following lines:
if(Time.deltaTime >   lastFire + fireDelay) to   if(Time.time >   lastFire + fireDelay)
and   lastFire = Time.deltaTime; to  lastFire = Time.time;