Search Unity

Shooting bullets doesn't work

Discussion in 'Getting Started' started by MRcoderboss, Aug 7, 2019.

  1. MRcoderboss

    MRcoderboss

    Joined:
    Aug 7, 2019
    Posts:
    18
    The problem is that it doesn't fire bullets at the center of the screen.Please help me.
     

    Attached Files:

    • fire.cs
      File size:
      998 bytes
      Views:
      68
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,562
    Well what does it do?

    Check for any console errors. Add Debug.Log statements to see what path the code is taking. Such as output the value of playerUI.ammo. For all I know it is set to 0, so pressing the mouse button to fire does nothing.