I want to make a button that add +1 to a variable instead of simply doing the on or off thingy
Does anyone know how to use funky tree like this in the situation?
For reference,the only use of this will be a number display that can go up when i press a button.
dang why is simple plane not simple
@PlaneFlightX ohhh okay thanks I'll try that
@Yish42 Add a variable setter with the same name as the button and put 0 as the expression.
@PlaneFlightX the interactionType i set is once,but i dont know about setting the button to zero
@hpgbproductions @Yish42 The button should also have a setter to 0, and an interactionType of Once or Continuous. Please note rate(x) in this case will be 100 or -100 for one single update.
@SILVERPANZER @hpgbproductions thank you two for the help,however i dont know if it's just me but i cant get it to make it work i tried all 3 and they either worked for only once or they would completly go to a 100 directly
If you guys have time could you tell me what i did wrong?
(On this one it use silverpanzer's code)
https://www.simpleplanes.com/a/7Wk729/varation-control-button
Easier to read and understand (at least for me):
.
SETTER x:
x+1
ACTIVATOR
rate(myButton)>1
.
Alternatively, if you don't like activators:
SETTER x:
rate(myButton)>1 ? x+1 : x
.
The rate function can detect the change in boolean or discrete values for exactly 1 funky tree update. The value it is checked against (1) is arbitrary.
smooth(ButtonA>0?100:0,ButtonA>0?100:0)
Increases the number by one with each press of the button, the number added can be changed by changing
100
to another number.