General
Basic scripting question: Faders & negative/positive values
Started by voyagingmind on .
Sign in or create an account to join the conversation.
I just started looking into lemurs scripting/expressions.
And was wondering what a simple method would be to convert a Faders.x value 0 - 1 to say control the speed of e.g. a multi-ball which has a range of -5 - 5.
so e.g. a fader value if .5 would equate to a speed of zero, 1 would be speed 5, and 0 speed -5
It's been a while since I've scripted, and my math is pretty rusty.
This is a basic enough a question, I don't want to seem lazy, but I'm sure assistance in this would also help other sunday scripters like me getting started with lemur.
If i find something in the meantime I'll post it, either way, your help is appreciated.
And was wondering what a simple method would be to convert a Faders.x value 0 - 1 to say control the speed of e.g. a multi-ball which has a range of -5 - 5.
so e.g. a fader value if .5 would equate to a speed of zero, 1 would be speed 5, and 0 speed -5
It's been a while since I've scripted, and my math is pretty rusty.
This is a basic enough a question, I don't want to seem lazy, but I'm sure assistance in this would also help other sunday scripters like me getting started with lemur.
If i find something in the meantime I'll post it, either way, your help is appreciated.
Subject: Re: Basic scripting question: Faders & negative/positive val
10*x-5Subject: Re: Basic scripting question: Faders & negative/positive val
Or you could use the range function:range(x, -5, 5) , it assumes the first value (x in this case) to be between 0 and 1.
Subject: Re: Basic scripting question: Faders & negative/positive val
Doh! Thanks armatronix, so simple, now i really feel stupid, heh Also thank you mbncp for making me aware of the range function, very practical.