Troubleshooting
How do I randomize the state of a Switch?
Started by danielmkarlsson on .
Sign in or create an account to join the conversation.
Hello.
I would like to randomize the state of a switch w/ a pad.
I'd be very grateful for any help I can get.
All the best
Daniel M Karlsson
RandSwitchState.jzml
I would like to randomize the state of a switch w/ a pad.
I'd be very grateful for any help I can get.
All the best
Daniel M Karlsson
RandSwitchState.jzml
The x value for a switch can only be 0 or 1. rand() gives you a number between 0 and 1 that is not likely exactly 0 or 1. You can fix this in your script by rounding the random value:
UltraSoloSwitch.x=round(rand());Right. Integers and floats.
Works like a charm now.
Thank you very much for your help brianc.
Works like a charm now.
Thank you very much for your help brianc.