Copy link to clipboard
Copied
I'm trying to make a neat lightning effect and I'm stuck.
I want a comp that will create a new segment of path every frame. the start point of each segment will be the end point of the previous segment and the end point will be pointing towards a designated end point with random jitter added in.
I have been able to start on it, building a new shape within the main layer for each segment, but in order to tell these segments where to start, I have had to create a null object that references the end point of the previous segement, and point the start point towards that null. I would like to be able to have the expression on the path automatically point to the end point of the shape directly above it, so that I can just duplicate these shapes over and over and not have to create the null and go in and change the numbers in the expression every single time. I have been having trouble understanding the process of pointing towards another shape within the same layer. If someone could explain what these commands are and how they work, I would be eternally grateful!
Copy link to clipboard
Copied
It's not a direct answer to your question... but are you aware of:
Effects > Generate > Advanced Lightning ?
Copy link to clipboard
Copied
very cool!
that is exactly the sort of thing I'm trying to build.
To be more clear, my ultimate goal is not to create a lightning effect, but to learn how to use expressions. I learn better by doing something than just by reading about it. Thanks for the tip!
Copy link to clipboard
Copied
First question: Where did you get that expression. I didn't try and copy it to test it but it looks like someone is trying to tie position to a vector path. That will not work.
If you want to start learning expressions the first stop is the Expression language reference. Then you should head over to Dan Ebberts https://www.motionscript.com. You'll need to run through both of those sites to start to get a handle on the tool.
Copy link to clipboard
Copied
Hey Rick,
I wrote that expression myself, and believe it or not, it does work!
thanks for the links, those are super helpful!
Copy link to clipboard
Copied
While in theory, it should be possible to do what you're trying to do, in practice, the cascading nature of the calculation (where each path's expression has to reference the previous path's points), especially throwing randomness into the mix, things will grind to a halt pretty quickly when you start duplicating the paths. Setting it up would be an interesting experiement, just to know how to do it, but that's about it, I'm afraid.
Dan