Profile image

Reload-able cannon with variable (solved)

7,771 Bogey  1.1 years ago

  • I want to make a cannon that activate when a certain variable value > 0.
  • So I name the variable ammo with value range from min 0 to max 10.
  • For reloading, a certain input will set the ammo value to 10. But ammo value stay at 10 if the input is released (not reverting back to 0).
  • When i fire the gun (ignoring fire rate), the ammo value deducted by 1 each time i press/hold fire input until it reached the limit 0.

But the FT on the pic above doesn't work. I tried both input and the ammo value didn't change. Could someone help me?


Edit:

  • Answer've been pinned in comment.
  • ammo= 10 bugged. But ammo+ 1 works well.
  • Turns out the increment/depletion rate is really fast. It's more fitting for duration based than round based firing.
  • Log in to leave a comment
  • Profile image
    55.6k PlaneFlightX

    With the two setters where you put Activate1 and FireWeapons in the variable name, put those two inputs in the activator field (click the dropdown). Place "ammo" in the newly empty variable names.

    Pinned one year ago
  • Profile image
    2,639 Zhixunlin23

    Why no updoots?

    10 months ago
  • Profile image
    7,771 Bogey

    @ivan6uy The predecessor, North Carolina class.

    one year ago
  • Profile image
    258 ivan6uy

    @Bogey lemme guess iowa class battleship

    one year ago
  • Profile image
    7,771 Bogey

    @ivan6uy I guess only 30% done.

    one year ago
  • Profile image
    258 ivan6uy

    hey so how's you're battleship going

    one year ago
  • Profile image
    7,771 Bogey

    @PlaneFlightX It worked! Thanks!

    +1 one year ago
  • Profile image
    7,771 Bogey

    @PlaneFlightX sorry for ping but could you help me with this problem? I failed math.

    one year ago