# Control Rate With Slider

**URL:** https://forum.highend3d.com/t/control-rate-with-slider/1109
**Category:** Maya
**Tags:** mel
**Created:** [March 23, 2009, 2:07pm UTC](https://forum.highend3d.com/t/control-rate-with-slider/1109 "2009-03-23T14:07:57Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jonjo](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/9e8a1a/32.png) [@jonjo](https://forum.highend3d.com/u/jonjo)
#### Post date: [March 23, 2009, 2:07pm UTC](https://forum.highend3d.com/t/control-rate-with-slider/1109/1 "2009-03-23T14:07:57Z")

</div>

Hi, me and a friend are doing a project in uni based on particles. We are in the process of doing a GUI, but have come a little stuck. basically all we need to do is create a float slider to control the rate of the particles. We thought it would be easy, but for some reason we cant seem to get it to work properly.

many thanks in advance ![]()

---

<div class="post-metadata">

### Author: ![mlefevre](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/a3d4f5/32.png) [@mlefevre](https://forum.highend3d.com/u/mlefevre)
#### Post date: [March 24, 2009, 12:05am UTC](https://forum.highend3d.com/t/control-rate-with-slider/1109/2 "2009-03-24T00:05:53Z")

</div>

Hey,

Hopefully this can give you ideas to develop.

Load the procedures into memory before executing ![]()

CODE  
global proc connectSliderUI(){

if (`window -exists particleRateWin`)  
&nbsp;&nbsp;&nbsp;&nbsp;deleteUI particleRateWin;

window  
&nbsp;&nbsp;&nbsp;&nbsp;particleRateWin;

columnLayout  
&nbsp;&nbsp;&nbsp;&nbsp;mainCol;

button  
&nbsp;&nbsp;&nbsp;&nbsp;-label "Select emitter and click me!"  
&nbsp;&nbsp;&nbsp;&nbsp;-c "connectSlider()"  
&nbsp;&nbsp;&nbsp;&nbsp;connectParticleBut;

floatSlider  
&nbsp;&nbsp;&nbsp;&nbsp;-min 0  
&nbsp;&nbsp;&nbsp;&nbsp;-max 1000  
&nbsp;&nbsp;&nbsp;&nbsp;-value 100  
&nbsp;&nbsp;&nbsp;&nbsp;-step 1  
&nbsp;&nbsp;&nbsp;&nbsp;particleRateSlider;

showWindow particleRateWin;

};

//========================================================

proc connectSlider(){

string $emitter[] = `ls -sl`;

connectControl particleRateSlider ($emitter[0] + ".rate");

};

Good luck!

-matt

---

<div class="post-metadata">

### Author: ![jonjo](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/9e8a1a/32.png) [@jonjo](https://forum.highend3d.com/u/jonjo)
#### Post date: [April 6, 2009, 7:38pm UTC](https://forum.highend3d.com/t/control-rate-with-slider/1109/3 "2009-04-06T19:38:54Z")

</div>

Thanks very much! Worked like a charm!
