November 9, 2013

Tutorial: Nifty Expression to Get Parallax Scrolling in After Effects

ParallaxWhen I first started dabbling in After Effects and Flash several years ago, the first videos I made were simple animations (think cave drawings.) Not really knowing anything about layers or expressions made for interesting results when I tried to achieve the parallax effect -- the illusion that objects move more quickly or slowly depending on how far away they are. Mikey Borup shares a tutorial that makes parallax scrolling a little bit easier. Continue on to watch the video:

Parallax scrolling is used a lot in video games, but can also be used in animation and other media. Essentially what this does is gives the illusion of depth using the parallax effect. There are several methods to achieve this, but Borup utilizes a semi-simple layering process in After Effects that slides each layer at different speeds across the frame.

If you're in need of a continuous background, or are creating a flat, two-dimensional animation that doesn't travel along the z-axis, this tutorial is pretty cut and dry and gives you the exact answers you're going to need in order to create it.

Now, using expressions in After Effects is an entire study by itself, let alone how to use them in this one instance. The main point of this tutorial, though, according to Borup, is the expression (as seen at 6:00):

spread=index*10*thisComp.layer("Control"­).effect("Slider Control")("Slider");

[transform.position[0]-spread,transform.­position[1]];

https://www.youtube.com/watch?v=mAvZl31iClA

Like I said, this is typically used for video games, but at least 3 or 4 of my early animations utilize this effect (poorly,) and if I had this knowledge of this nifty little expression earlier, maybe I wouldn't have had to spent hours and hours creating and perfecting keyframes.

What do you think? How often do you use parallax scrolling in your work? Did using this expression make things easier for you?

[via Mikey Borupwolfcrow]

Your Comment

4 Comments

I just move the front layer 10 units and the back layer 3 units. 4 keyframes. I think this expression is a bit OTT.

November 9, 2013 at 9:04PM, Edited September 4, 11:21AM

0
Reply
Tyler

Yep. That's what I did here:
http://www.youtube.com/watch?v=GJtDnr0pKfk

November 10, 2013 at 5:14AM, Edited September 4, 11:21AM

0
Reply

Thanks for posting this!!! If anybody is interested there are some comments on the video that have expressions for vertical movement as well.

November 10, 2013 at 11:11AM, Edited September 4, 11:21AM

0
Reply

Just came back to this post because I need this effect for a number of videos for work. IMO, this expression is far from "over the top" as Tyler said.. It does exactly what I love expressions for: saving time by avoiding repetitive/tedious keyframing. Wonderful!

February 11, 2014 at 12:16AM, Edited September 4, 11:45AM

0
Reply