Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Need help with randomizing rotation for multiple objects

Explorer ,
Oct 16, 2018 Oct 16, 2018

I am trying to have two logos rotate randomly independent of each other but they follow the exact same motions.  IE I want one logo to spin its own way while the other spins its own way.  Right now they do the exact same thing.  Here is a picture if it helps.  Screenshot (2).png

4.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 16, 2018 Oct 16, 2018

Play around with this:

seedRandom(index,true);

time*random(360)

Dan

Translate
Community Expert ,
Oct 16, 2018 Oct 16, 2018

You need to add a different random seed for each random number generator. You can easily figure out how to do that if you spend five minutes in the expression language guide you will find by typing “random expression” in the search help field at the top right corner of AE.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 16, 2018 Oct 16, 2018

I tried seedRandom but it didn't make any difference.  Screenshot (3).png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 16, 2018 Oct 16, 2018

Play around with this:

seedRandom(index,true);

time*random(360)

Dan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 16, 2018 Oct 16, 2018

Yes that worked!  Thank you both.  Could one of you possibly explain exactly what is going on in that script?  I'm not very good at scripting or programming.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 16, 2018 Oct 16, 2018

seedRandom(index,true) sets a unique random seed for each layer. random(360) generates a random number between 0 and 360, which, when multiplied by time will give you a rotation of that many degrees per second.

Dan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 23, 2023 Mar 23, 2023
LATEST

Hi, thanks for the explanation. Can you help me with randomly rotating a layer by 90 degrees each time?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines