click shooting how do i do it?

made a FPS pritty good i think anyway, i've made it shoot by pushing space, how can i make that shoot at a click? thanks for answering, assuming u answered. ;)

ah brilliant andyh81 thanks again 4 answering it worked perfectly accept is there a way i can now make it also jump??? thanks 4 ur time ;)

1 Answer

1

Just replace the space bar input command with

if(Input.GetButtonDown("Fire1")){ Shooting code here }

Fire1 is the same as left mouse button and fire2 = right mouse.

Assuming you haven't customized with the input panel in the inspector.