LIBRARY: Tutorials Reviews Interviews Editorials Features Business Authors RSS Feed

How to make a Text Stream using Expressions

COW Library : Adobe After Effects Tutorials : Joe Chao : How to make a Text Stream using Expressions
How to make a Text Stream using Expressions
Adobe After Effects Tutorial

How to make a Text Stream in After Effects 6.5 by Joe Chao

Joe Chao (Cao Jun) Joe Chao,
Jiangsu, China
©2006 Joe Chao and

Article Focus:
In this tutorial CreativeCOW's Joe Chao demonstrates using expressions to create a text stream wrapping around a pillar. The pillar and its background are all completely made in AfterEffects.

Now, please download the project file and get started.

A little more than a month ago, I saw a post seeking some ideas about making a kind of "text stream" in Creative Cow's AE forum. The person posting said that he tried to make it with Particle Playground, but failed because the shape of the stream was too complex. I think it seems that this task is too hard for AE's particular system. I have not found any filter of AE can create a particular system warping through a certain path. Although we can bend the particulars with a boundary wall or gravity force, or distort filters, we can not make a complex-shaped stream. Later, I found that expressions might work better in creating such a stream. After making up such an effect, I felt that maybe I could write a simple tutorial and share my experience with you.

Before we get started, I want to show my gratitude to Dan Ebberts. His help was critical to my project, I couldn't have made it without him. Dan, if you are reading this tutorial, please accept my cordial thanks.

The whole scene looks like this:

Text stream

Because we mainly focus on expressions, I don't want to spend too much time on making up this scene. So just download the project file, open it, and go to the comp "textstream". I have prepared everything for you.

My main idea is to create a "guide layer". It flies through a path, which we can adjust very easily. Then, create a Text layer, it imitates the guide layer, but it often makes some random "mistakes" in imitating. Such as: speed, size, position, in point, and so on. All these mistakes can be controlled through a null layer. Thus, every time I duplicate it, it make different mistakes. When I duplicate it for tens or even hundreds of times, I can get a stream of titles!

So my job is to apply some expressions to different properties of the text layer. The expressions can make the text go after the guide layer and made some random mistakes.

First of all, we have to make a "guide". Create a solid layer, set its size as 20*20. Then, I get a problem: how can I get it to fling in a helix path from the bottom of the scene and out at top?

Adjusting its motion manually is not a bad idea, but in fact we can make it by developing some expressions. Before that let's observe a helix from different view angles:

Helix from different angles

In this chart, I identified some variables, and they have been marked in the charts above:

Vel1: outward velocity
Vel2: rotation velocity
Vel3: upward velocity
Radius: Radius of the helix's bottom
Angletemp: angle at a certain time
Radiustemp: Radius at a certain time

With little trigonometry we can get the position of the guide layer at any time:

X position: -Math.cos(angletemp)* radtemp
Y position: -vel3*time
Z position: Math.sin(angletemp)* radtemp

That's it! Now we can develop the expressions of the path, add these expressions to position property of "guide":

vel1=20; // outward velocity
vel2=40; // rotation velocity
vel3=50; // upward velocity
radius=30; // Radius of the helix's bottom
radtemp=radius+vel2*time; // Radius at a certain time
angletemp=vel1*time; // angle at a certain time
a= -Math.cos(angletemp)* radtemp; // X position
b= -vel3*time; // Y position
c=Math.sin(angletemp)* radtemp; // Z position
[a,b,c] //output the position

These expressions are based on the requirement that the bottom center of the helix is at (0,0,0), but it is not the truth. So I created a solid layer, named it "center", converted it into 3D layer. Then, adjust the last line of the expression to:

[a,b,c]+thisComp.layer("center").position //output the position

Now we can control the motion of the guide layer by moving the "center" layer and adjusting the variables. Adjust them until you feel satisfied with the motion path.

Convert the expressions to keyframes by the menu "animation/keyframe assistant/convert expression to keyframes".

Change the expressions to: loopOut(type = "cycle", numKeyframes = 0). Now, our guide layer has been able to work perfectly. It flies around the pillar again and again. That's just what we want.

Since the guide layer is ready, our next step is to create the text.

Create a text layer, input any text you like, that doesn't matter. (I inputted "title"). Convert it into a 3D layer. Adjust its size & font.

Secondly, we are going to develop some expressions to make the titles be able to imitate the guide layer. Go to the position property of the title layer, and try adding this expression:


It works well. Then we will have to let it make mistakes.

  1. Random speed:
    Suppose that one layer has a new speed and it takes the layer certain time (new time) to cover the distance on which the guide spends certain time (original time).
    Thus: timerate = new time/original time
    If the current time is "time", where should our title be? The position must equal to the position of "guide" at "timerate*original time".
    Then, the expression for position has been developed to:
    Thus, as long as we set the variable "timerate" a random value, the title layer can have a random speed. So add this line for it:

  2. Random start time
    Suppose the all the titles are "latetime"'s later, and the time variable "latetime" have random values, than we can adjust the expression above into:
    seedRandom(n, timeless = true); //make different layers have different seed
    timerate=random(0.8,1.25); //add a random factor in speed
    latetime= random(0,10); // add a random factor in emitting the particulars
    when= (time-latetime)*timerate;
    thisComp.layer("guide").position.valueAtTime(when) //out put the position
    now, select the title, set its auto-rotation property to "orient along path".

    Try duplicating the title about 100 times. Yes, or 50~100 times. Then you will be able see such a result.

    Text Wrapping

    Interesting? The titles are moving along the path in random speed & order. Next we are going to add more random factors into their motions.

  3. Random offset:
    Create these expressions:
    xoffset=random(-20, 20);
    yoffset= random(-20, 20);
    zoffset= random(-20, 20); //these offsets can affect the thickness of the stream
    adjust the last line into:
    thisComp.layer("guide").position.valueAtTime(when)+[xoffset, yoffset, zoffset]

  4. Random path
    To let different titles have different paths, I think the expression wiggle can work in this case. But unfortunately, it seems that "wiggle. thisComp.layer("guide").position.valueAtTime(when)" can't work well. Dan advised me to appeal to "wiggle" itself. With his help, I got this expression for position property:
    thisComp.layer("guide").position.wiggle(amp, freq, 1, .5, when)+ [xoffset, yoffset, zoffset]

  5. Scale
    Add these expressions to Scale property:
    seedRandom(n, timeless = true);
    temp=random(min, max);

  6. Etc
    In the paragraph about random start time, I added some random factors into the start time of the titles. Since the guide are making a looping animation. I think the length of the guide's animation can work well as the maximal value of "latetime". So if we let expressions control the maximal value of the random "latetime" is better. Thus, we can develop this line into:

    latetime= random(0,looptime);
    Thus, the data of maximal random value can get updated automatically.

    Similar as the "freq" in "Random path". "Freq" means "how many times every second", if we replaced it with "freq/looptime", it would become "how many times every cycle". It might make our work simple if we have to adjust the path again and again.

  7. Text
    Apply these expressions to "source text" property:
    seedRandom(n, timeless = true); //make different layers have different seed
    myText = ["After Effects",
    "Encore DVD",
    "Premiere Pro",
    "Final Cut Pro",
    "Cinema 4D",
    "Particle Illusion"]; // make up a list of titles
    myIndex = Math.floor(random(myText.length)); //count the number of the titles in the list
    myText[myIndex] // random pick up a title

  8. Control
    With all expressions above, we have been able to create a stream of titles. What we need to do is just to duplicate the title layer for 50~100 times. But if you need to adjust the factor after that, you might have trouble in opening all the layers and update the variables' values. So we need something to administrate all these factors.

    My idea is create a Null layer and apply "expression controls" filters to control them. Let's take the max & min value of Scale property for example.

    Create a null layer named "control". Apply effects/expression controls/slider control to it. Rename the filter as "scalemin", change the slider range into 0~100. Duplicate this filter and rename it as "scalemax", Go to the expressions of scale property. Adjust them into:
    seedRandom(n, timeless = true);
    scalemin =thisComp.layer("control").effect("scalemin")("Slider");
    scalemax =thisComp.layer("control").effect("scalemax")("Slider");
    temp=random(scalemin, scalemax);

    Now, we can adjust the scale of all the titles with this slider at any time. We can also adjust all other factors in the same way. In my project file, I made a lot of sliders to take control of many other factors.

  9. Random color
    Add text animation for the title, apply these expressions to fill color property:
    seedRandom(n, timeless = true);

    BTW, you can also add some other text animations for the titles.

  10. Orient along path
    In my case, I found an odd thing, that sometimes "orient along path" could work well. I think it might because there are some little jags along the path. Sometimes, the title, which should "orient along path", rotates like mad! So, I developed these expressions for orientation property:

    lookAt(position.valueAtTime(time), position.valueAtTime(time+1/25))

    BTW, if your "orient along path" worked well, these expressions are not necessary.

At last, after finishing all the steps above, we have only one thing to do: duplicate, duplicate, duplicate, duplicate, duplicate, duplicate, duplicate, duplicate………keep duplicating until you get enough titles. If there is anything you are unsatisfied with, just adjust the responsible sliders.

Here are my results:


Amazing animation

Nice? We at last go through so much trouble for this effect, but I think if we use these techniques for more animations, we can surely get more amazing animations.

Feel free to ask questions or make comments in the After Effects forum at CreativeCOW.

If you found this page from a direct link, please visit our forums or read other articles at

Related Articles / Tutorials:
Adobe After Effects
Create an Arrow or Pointer preset for After Effects

Create an Arrow or Pointer preset for After Effects

In this video tutorial, Graham reveals a really quick way to use Shape Layers to make an arrow preset that you can use to point to anything in Adobe After Effects.

Graham Quince
Adobe After Effects
Realistic Water Movement with Fractal Noise

Realistic Water Movement with Fractal Noise

In this tutorial video, Andy Ford shows you how to use the Fractal Noise effect in After Effects to add movement to water in a still photo

Andy Ford
Adobe After Effects
Adobe Creative Cloud September 2020 Update: Streamlined workflows that make storytelling easier

Adobe Creative Cloud September 2020 Update: Streamlined workflows that make storytelling easier

The current environment is forcing us to rethink and reimagine so much. Content creators, from broadcasters to streaming services to social video creators, are finding new ways of working that prove creativity and resourcefulness are inherent to the video industry. Adobe's Eric Philpott explores Adobe's developments in response to the ever evolving challenges we face today.

Eric Philpott
Adobe After Effects
Makin' Planets! Saturn (with rings and shadows)

Makin' Planets! Saturn (with rings and shadows)

In this video, Graham shows how to make Saturn's rings using Polar Coordinates, then use an Alpha Invert Matte along with a simple expression to cut the rings out.

Graham Quince
Adobe After Effects
Text Box Background Preset in After Effects

Text Box Background Preset in After Effects

Graham's latest tutorial shows you how to combine several effects to generate a background for any text layer you add to an After Effects comp.

Graham Quince
Adobe After Effects
Makin' An Eclipse

Makin' An Eclipse

In this tutorial for Adobe After Effects, I use the Circle effect, Fractal Noise, Polar Coordinates and CC Light Rays to create a 2D solar eclipse.

Graham Quince
Adobe After Effects
How To Put Yourself In Any Movie Part 3: Keying Greenscreen

How To Put Yourself In Any Movie Part 3: Keying Greenscreen

Following the huge response to parts one and two of independent filmmaker Cody Pyper's Adobe Photoshop and After Effects tutorial series, "Put Yourself In Any Movie!", here is the truly EPIC series finale, which is the most complete single keying tutorial we've ever seen. It's all here, including Red Giant's Primatte Keyer, Premiere Pro's Lumetri Color Panel, AE's Keylight filter, everything you need to know about curves and levels, realistic blurs, shadows and VFX, and more! Did we mention that this is epic? EPIC!

Cody Pyper
Adobe After Effects
Makin' a 3D Nebula in Photoshop, Cinema4DLite, and After Effects

Makin' a 3D Nebula in Photoshop, Cinema4DLite, and After Effects

Graham continues his space tutorial series, featuring the Orion Nebula

Graham Quince
Adobe After Effects
Motion Tracking in After Effects

Motion Tracking in After Effects

During this short video tutorial, Andy Ford shows you how to apply Track Motion to aerial drone footage

Andy Ford
Adobe After Effects
Free Tablet and Phone Screen Replacement Tracking Images

Free Tablet and Phone Screen Replacement Tracking Images

Here's a giveaway for anyone interested in trying to do a screen replacement for their iPad, iPhone, Tablet or phone.

Graham Quince
© 2020 All Rights Reserved