Page 1 of 1

Increase values as long as button is pressed

PostPosted: Sun Apr 03, 2016 7:38 pm
by pianist
I want to increase a value with an increment of 0.1 as long as a joystick button is pressed so the resulting number is accumulating. How do I accomplish this? It's very simple if using a keyboard shortcut - then the value just increases continuously as long as you hold the key pressed. How to achieve the same behaviour with the joystick button?

I have a very simple custom script node with a variable, MasterTemp:

If 152Button8 > 0 then

True Script
MasterTemp += 0.1

And this works fine - however only increasing 0.1 per click.

Re: Increase values as long as button is pressed

PostPosted: Mon Apr 04, 2016 11:23 am
by Christian Hinxlage
Hi,

send your command " MasterTemp += 0.1 " via a script timer. Here additionally you can type in the interval the value of your variable should increase.
With the joystick button just send the start and stop commands for the script timer via a script output node.

Best regards

Christian

Re: Increase values as long as button is pressed

PostPosted: Mon Apr 04, 2016 11:51 am
by pianist
Excellent - thank you!