Spaz8 Posted July 7, 2016 Share Posted July 7, 2016 So I have a switch node I want to direct based on what another switch node's channel is set to. AFAIK || is the "OR" nomenclature but going back to H13 I have not been able to get this to work. Basically if the first switch is set to 3, 5 or 6 set the second switch to 1.. if its not 3,5 or 6 flip it the other way. This is the expression that I have, but it seems to result in in any value being true (1). What am I doing wrong? it doesn't error if(ch("../switch_GLV/input")==3 || 5 || 6, 1,0) Quote Link to comment Share on other sites More sharing options...
f1480187 Posted July 7, 2016 Share Posted July 7, 2016 if(ch("../switch_GLV/input") == 3 || ch("../switch_GLV/input") == 5 || ch("../switch_GLV/input") == 6, 1, 0) It is unnecessary to wrap it if you need to return true if true and false if false. Unless you type it for testing puproses, you may simplify it to this: ch("../switch_GLV/input") == 3 || ch("../switch_GLV/input") == 5 || ch("../switch_GLV/input") == 6 Multi-line style using variable. { float input = ch("../switch_GLV/input"); return input == 3 || input == 5 || input == 6; } If you switch to Python, you may use: ch("../switch_GLV/input") in (3, 5, 6) Quote Link to comment Share on other sites More sharing options...
Spaz8 Posted July 7, 2016 Author Share Posted July 7, 2016 Awesome, thank you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.