Some times in Maya you may have a need for smooth yet random motion. For some fast, easy to control and replicatable ‘random’ motion, consider using the noise(time) in an animation expression.
Toise(time) by itself outputs values between -1 and 1. If you were to create an object named CUBE, and you wanted random motion between -1 and 1 on the y axis, open the expression editor and type CUBE.translateY = noise(time);
Press ‘create’ and there you go. That’s it. The mystery of Maya expressions have been revealed to you. This expression all fine if you need values that only ever drift slowly between 1 and 0, but you will need to add a little bit more info if you want to do anything different. Remember algebra from school? Finally there is an application for it! Here are some examples:
To output values between 0 -1:
(noise(time) + 1) / 2;
To output values between 0 – 90:
(noise(time) + 1) * 90) / 2;
To have noise 4 times faster and output values between 35 – 90:
((noise(time * 4) + 1) * 27.5) + 35;
It may take a little bit of time to wrap your head around the idea of Maya expressions, but once you have the basics under your belt I can assure you that you will not know how you ever survived without it. It is worth mentioning that I have found noise actually outputs slighlty beyond -1 and 1. If this poses an issue, use the clamp command in combination with the expression.
This is great. Exactly what I needed.