Page 1 of 1

Multiballs speed

Posted: 06 May 2013 15:15
by alloedee
Hello there.

Iam working on a project using multiple multiballs, with a knob that controlling the speed of the multiballs (same as iPad - Bouncing XY Balls) But I cant figure out how I can lower the values of the knob, so It is only controlling the speed values at very low speed (ect. 0.01-0.1) I dont need the balls to bouncing around at high speed.

Hope It makes any sense

Thx alloede

Re: Multiballs speed

Posted: 06 May 2013 19:17
by Softcore
x*0.1 will give you output in a range of 0 - 0.1 ;)

Re: Multiballs speed

Posted: 06 May 2013 20:42
by nitefish
and
range(Fader.x, 0.01, 0.1)
if you don't want to reach zero.

Re: Multiballs speed

Posted: 13 May 2013 12:30
by alloedee
Sorry but iam a total n00b. Where should I put these lines?

Re: Multiballs speed

Posted: 13 May 2013 13:05
by Softcore
How are you using the knob to control the MultiBall's speed?

Re: Multiballs speed

Posted: 13 May 2013 13:56
by alloedee
Iam using the iPad - Bouncing XY Balls project

Re: Multiballs speed

Posted: 13 May 2013 16:24
by Softcore
Ok sorry for the delay...here's how you fix it.....

Using the PC-Mac editor, first of all select one of the multiball objects....go to the "objects" window and select "behavior" tab.
Now notice that in the "speed" attribute it is typed:

Code: Select all

(Speed.x*4.5)-2.25
What this does is, it takes the knob "Speed" x and "transforms it into values ranging from -2.25 to 2.25

example:
for x=0, (knob full left) speed=(0*4.5)-2.25=-2.25
for x=0.5 (knob at middle) speed=0.5*4.5-2.25=0
for x=1 (knob at full right) speed=1*4.5-2.25=2.25
Remember that the "working" range for Speed is from -5 to 5 so by default, the template provides half the maximum speed a multiball could have.

Of course, you need even slower as you said so....

....lets say you wanted a range of -1 to 1. You change the above equation to this:

Code: Select all

(Speed.x*2)-1
If you dont even want "negative" speed, you can just type

Code: Select all

Speed.x

Once you are finished with a range you like fo rone multiball project, copy-paste your final equation to the other 3 multiball objects too. Finally, the knob will still display the "old" -2.25 to 2.25 range. To fix this, select the speed knob and ungroup it from the - and + texts so that you can edit its properties. Once you 've ungrouped it, select in the "objects" window the "properties" tab - there, by sheer coincidence ( Im kidding of course :P ) you will see that the "value" property has the same equation that the multiballs used to have. Insert here again, your own equation (the one you have typed in the multiballs) and you are done. In this case you dont need to type Speed.x - you just type x.

;)