# Randomize Selection Order? Expressions Help

**URL:** https://forum.logik.tv/t/randomize-selection-order-expressions-help/3824
**Category:** Flame Questions
**Tags:** expressions
**Created:** [September 16, 2021, 4:00pm UTC](https://forum.logik.tv/t/randomize-selection-order-expressions-help/3824 "2021-09-16T16:00:11Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![lauren](https://avatars.discourse-cdn.com/v4/letter/l/b4bc9f/32.png) [@lauren](https://forum.logik.tv/u/lauren)
#### Post date: [September 16, 2021, 4:00pm UTC](https://forum.logik.tv/t/randomize-selection-order-expressions-help/3824/1 "2021-09-16T16:00:11Z")

</div>

Hey Logik Hive,

Is there a way to randomize selection order within an expression? I would like to avoid manually selecting a random order if possible!

Thanks!

---

<div class="post-metadata">

### Author: ![BrittCiampa](https://avatars.discourse-cdn.com/v4/letter/b/ec9cab/32.png) [@BrittCiampa](https://forum.logik.tv/u/BrittCiampa)
#### Post date: [September 16, 2021, 5:45pm UTC](https://forum.logik.tv/t/randomize-selection-order-expressions-help/3824/2 "2021-09-16T17:45:42Z")

</div>

> **[Random Number Functions | Flame Products 2017 | Autodesk Knowledge Network](https://knowledge.autodesk.com/support/flame-products/learn-explore/caas/CloudHelp/cloudhelp/2017/ENU/Flame/files/GUID-98200360-E359-428A-92DA-4F778769692F-htm.html)**
>
> Use the following functions to create curves based on random values. rand Returns a random value between -1 and 1, based on the value used as an argument, called the seed. Using the same seed in the rand function for multiple channels produces the...

I think this might be helpful?

---

<div class="post-metadata">

### Author: ![lauren](https://avatars.discourse-cdn.com/v4/letter/l/b4bc9f/32.png) [@lauren](https://forum.logik.tv/u/lauren)
#### Post date: [September 16, 2021, 6:14pm UTC](https://forum.logik.tv/t/randomize-selection-order-expressions-help/3824/3 "2021-09-16T18:14:27Z")

</div>

Thank you! Any idea how to get the random animation to start at frame 1 and not go beyond frame 1 in the negative?

---

<div class="post-metadata">

### Author: ![Sinan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/sinan/32/155_2.png) [@Sinan](https://forum.logik.tv/u/Sinan)
#### Post date: [September 16, 2021, 9:57pm UTC](https://forum.logik.tv/t/randomize-selection-order-expressions-help/3824/4 "2021-09-16T21:57:49Z")

</div>

I’m guessing you have an array of axes (or surfaces) you want to animate using a master channel as the driver.  
If that is the case you can use the eval function with a frame offset that is randomized using SelectionOrder. Oh, that sounds like rocket science, ok this pseudo function then:  
main\_axis is your source anim  
my\_axis = eval (main\_axis, ( frame - rand (SelectionOrder) )  
Maybe not exactly this format for _rand_ but something in those lines  
Does this make sense? If I could understand what you’re trying achieve…

---

<div class="post-metadata">

### Author: ![lauren](https://avatars.discourse-cdn.com/v4/letter/l/b4bc9f/32.png) [@lauren](https://forum.logik.tv/u/lauren)
#### Post date: [September 16, 2021, 11:01pm UTC](https://forum.logik.tv/t/randomize-selection-order-expressions-help/3824/5 "2021-09-16T23:01:31Z")

</div>

All good, thanks Sinan! I figured out how to use rand with some success!

eval(control, frame-rand(SelectionOrder))
