logo hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    Weapon Shooting issue

    Scheduled Pinned Locked Moved
    General Discussion
    3
    6
    258
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • AeroA
      Aero
      last edited by

      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.
      Cheers.

      Aidan_FireA 1 Reply Last reply Reply Quote 0
      • Aidan_FireA
        Aidan_Fire @Aero
        last edited by

        @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.

        1 Reply Last reply Reply Quote 0
        • AeroA
          Aero
          last edited by Aero

          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.

          MelideM 1 Reply Last reply Reply Quote 0
          • MelideM
            Melide @Aero
            last edited by

            @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.

            1 Reply Last reply Reply Quote 0
            • Aidan_FireA
              Aidan_Fire
              last edited by

              There are many ways you can do it. Personally, this is how mine would work (assuming the gun is automatic):
              9B194984-B541-4C17-9589-BFD2AEB2A6CC.png
              In case you don't know how to produce that Set Input Field behaviour:
              F29E6B2B-04CF-46D0-8A5D-16E651A25608.jpeg

              1 Reply Last reply Reply Quote 1
              • AeroA
                Aero
                last edited by

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

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post