Firing a bullet (new to unity)

Welcome! If you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: Using code tags properly

It appears the above script simply does an instantaneous raycast (invisible) to see what you hit. There is no code that sends a bullet out over time, or draws a line where the raycast is.

Some solutions:

  1. look for an entirely different bullet shooting tutorial on Youtube and see what they do. There’s a lot of different ways to go about it: 2D, 3D, first person, etc.

  2. try your hand at adding a LineRenderer component, giving a reference to that above script, and feeding the begin and end points of the LineRenderer with your gun muzzle and the point of impact, and making the zap effect yourself.