Profile image

Reload-able cannon with variable (solved)

6,860 Bogey  6 months 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
    49.3k 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 5 months ago
  • Profile image
    2,540 Zhixunlin23

    Why no updoots?

    3 months ago
  • Profile image
    6,860 Bogey

    @ivan6uy The predecessor, North Carolina class.

    5 months ago
  • Profile image
    254 ivan6uy

    @Bogey lemme guess iowa class battleship

    5 months ago
  • Profile image
    6,860 Bogey

    @ivan6uy I guess only 30% done.

    5 months ago
  • Profile image
    254 ivan6uy

    hey so how's you're battleship going

    5 months ago
  • Profile image
    6,860 Bogey

    @PlaneFlightX It worked! Thanks!

    +1 5 months ago
  • Profile image
    6,860 Bogey

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

    5 months ago