Shooting Laser:

Create new 3d Object,Capsule.
Make prefab of enemy object.
Create and Apply material to laser object.
We can see Private field in Inspector.
Assign Laser prefab in Player script.
This will check the key pressed event for space key.
Shooting Laser

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store