ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Randomize position on a text layer animator by word.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Chris Curry
Randomize position on a text layer animator by word.
on Apr 19, 2017 at 9:19:24 pm

I have a text layer with many words and a range selector animating the Start from 0 - 100% 'based on' words (not characters).

The positions I want the words to start at I would like to be random but limited to specific starting positions:
x-axis can start from -1700 (left) or 1700 (right)
y-axis can start from -600 (left) or 600 (right)
z-axis can start from -2100 (top) or 0 (bottom)
I want those starting points to be randomized to each word.

Currently I have:
ran = random(0,1);
x = [-1700, 1700];
y = [-600, 600];
z = [0, -2100];
[(x[Math.round(ran)]),(y[Math.round(ran)]),(z[Math.round(ran)])]

With this, each frame it is randomizing the position and I want it to randomize for each word but only one axis per word.

An example that I want it to be random:
Word 1 starts at -1700 on the x-axis and animates to final position
Word 2 starts at 600 on the y-axis and animates to final position
Word 3 starts at -2100 on the z-axis and animates to final position
Word 4 starts at -600 on the y-axis and animates to final position

All help is appreciated.

Thanks

Screenshot:


Return to posts index

Dan Ebberts
Re: Randomize position on a text layer animator by word.
on Apr 19, 2017 at 10:17:04 pm

Play with this:

Create position animator with Position value of 1700,600,-2100
Add Expression Selector
Delete Range Selector
Set Expression Selector's Based On property to Words
Replace Expression Selector's Amount expression with this:

startPositions = [[100,0,0],[-100,0,0],[0,100,0],[0,-100,0],[0,0,100]];
moveTime = 1;
seedRandom(textIndex,true);
myStartPos = startPositions[Math.floor(random(startPositions.length))];
linear(time,inPoint,inPoint+moveTime,myStartPos,[0,0,0]);



Dan



Return to posts index

Chris Curry
Re: Randomize position on a text layer animator by word.
on Apr 19, 2017 at 10:44:58 pm

Hey Dan,

That is pretty close!!

I need the first word to come from off screen into place followed by the next word and so forth - not all of them at the same time.

Also, instead of "inTime,inPoint+moveTime" - can I control the timing via keyframes?

Thanks!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]