# Slowing Down Rand

**URL:** https://forum.highend3d.com/t/slowing-down-rand/3052
**Category:** Maya
**Tags:** mel
**Created:** [June 7, 2006, 11:24am UTC](https://forum.highend3d.com/t/slowing-down-rand/3052 "2006-06-07T11:24:41Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![mattdleonard](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@mattdleonard](https://forum.highend3d.com/u/mattdleonard)
#### Post date: [June 7, 2006, 11:24am UTC](https://forum.highend3d.com/t/slowing-down-rand/3052/1 "2006-06-07T11:24:41Z")

</div>

Hi there,

I have created an expression to make an object randomly move about

cellWall.translateX=rand(0.01,0.02)  
cellWall.translateY=rand(0.01,0.02)  
cellWall.translateZ=rand(0.01,0.02)

It changes it's position on every frame.

Is there any way to make it move less, i.e. every 5 frames or 10 ? BUT still interpolate between each random key frame. I don

---

<div class="post-metadata">

### Author: ![joojaa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@joojaa](https://forum.highend3d.com/u/joojaa)
#### Post date: [June 7, 2006, 11:50am UTC](https://forum.highend3d.com/t/slowing-down-rand/3052/2 "2006-06-07T11:50:20Z")

</div>

Use noise instead of rand!

---

<div class="post-metadata">

### Author: ![mattdleonard](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@mattdleonard](https://forum.highend3d.com/u/mattdleonard)
#### Post date: [June 7, 2006, 11:58am UTC](https://forum.highend3d.com/t/slowing-down-rand/3052/3 "2006-06-07T11:58:56Z")

</div>

Hiya,

Please can you be more specific ?

What would be the expression I would need to use ?

Many thanks,

Matt

---

<div class="post-metadata">

### Author: ![joojaa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@joojaa](https://forum.highend3d.com/u/joojaa)
#### Post date: [June 7, 2006, 1:06pm UTC](https://forum.highend3d.com/t/slowing-down-rand/3052/4 "2006-06-07T13:06:15Z")

</div>

CODE  
$magnitude=1;  
$freq=0.1;  
$noise=$magnitude\*dnoise($freq\*time\*\<\>);  
nurbsSphere1.translateX=$noise.x;  
nurbsSphere1.translateY=$noise.y;  
nurbsSphere1.translateZ=$noise.z;

---

<div class="post-metadata">

### Author: ![dammit\_jim](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/d/f475e1/32.png) [@dammit\_jim](https://forum.highend3d.com/u/dammit_jim)
#### Post date: [June 12, 2006, 2:24pm UTC](https://forum.highend3d.com/t/slowing-down-rand/3052/5 "2006-06-12T14:24:20Z")

</div>

Don't set a key frame every frame, set one every two to five frames. This will leave room for the interpolations you want. They are there but you don't see them. If you already set random keyframes on everything, you can also scale the animation curves in time. I like the animToolbox script for randomizing, scaling, and offseting animations curves. It might be worth your time to check that one out too.

Jim

---

<div class="post-metadata">

### Author: ![joojaa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@joojaa](https://forum.highend3d.com/u/joojaa)
#### Post date: [June 12, 2006, 7:40pm UTC](https://forum.highend3d.com/t/slowing-down-rand/3052/6 "2006-06-12T19:40:39Z")

</div>

Hes not settig keys just using expressions.
