Copy link to clipboard
Copied
Imagine this:
A murmuration of Starlings. When a bird moves to the left, it becomes green, and once they start moving to the right, it becomes red. In that way, we'll have green and red birds simultaneously, depending on which side they are moving to.
Does anyone know how to do it in AE, especially the color transition?
The Murmuration, I already found a way.
https://www.creationeffects.com/effects/murmuration-effect
Copy link to clipboard
Copied
I think the simplest approach would be to start with a color expression like this:
v = transform.position.velocity;
v[0] > 0 ? [1,0,0,1] : [0,1,0,1]
Copy link to clipboard
Copied
Thank you Dan.
I tested it with a single element, and it seems to work.
Could you explain the logic of this expression? I'm not very familiar with expression yet.
Would it be possible for me to use orange and purple instead of green and red?
Again, thank you very much
Copy link to clipboard
Copied
The expression just looks at the x component of the layer's velocity (v[0]). If it's positive, the layer is going to the right, otherwise to the left. You could define the colors with variables, like this:
leftColor = [1,.5,0,1]; // orange
rightColor = [.3765,0,1,1]; // purple
v = transform.position.velocity;
v[0] > 0 ? rightColor : leftColor