Weapon Shooting issue

  • Greetings all, new here

    My issue, weapon continuously fires when the value of bullets is at 0.

    Would it be best to turn off “shooting button” behavior.
    Or instead Leave shooting button on, and base shooting options on the value of bullets acquired.

    Input appreciated.

  • @Aero It depends on the kind of setup you're trying to make. The number of bullets field in the shoot behaviour I think just means how many bullets can exist at one time.

  • My gun button is kinda like this.
    How wrong or right is this? Both sets linked to gun

    Behavior one
    A. Shoot with button
    B. Subtract Value -1
    C. Add to score

    Behavior two
    A. Get value
    B. If value 1>0
    C. Shoot with button ( behavior on)
    D. if value 0=0
    E. Shoot with button ( behavior off)

    The goal is to disable shooting when there is no rounds left.

  • @Aero You can be creative on that. Also using an array could work: Creating for example 6 value in the array> When you shoot, it removes one value of the array and check how many values left in the array with the " Get Array Count " behavior, if the " Get Array Count " become 0 then it'll directly turn off the " Shoot with button " and turn on another behavior that is " Start Touching ". While you " Start Touching ", it will directly turn off the " Start Touching " behavior and read what is next wich is adding 6 value in the array and waiting maybe 0.4 second before turning on the " Shoot with button " and you could also put an audio of a reloading weapon to shows that the weapon is reloaded.

  • There are many ways you can do it. Personally, this is how mine would work (assuming the gun is automatic):
    In case you don't know how to produce that Set Input Field behaviour:

  • @Aidan-Oxley Thank you that is a helpful outlook.

Log in to reply