I followed this tutorial to create lightning bolts. It gives me some parameters (bolt opacity, bolt length) that I'm manipulating with keyframes: it shoots down in 1/10th of a second, then fades to transparent.
I want to spawn a number of these randomly on a surface. I'm doing this with a particle emitter on a plane with the lightning as the emitter object. It's working.
The lightning bolts have displace modifiers on them which control their shape: I want the values for these to change for each emitted particle, so each looks different. I'm not sure how to do this. In the tutorial these are tied to a second empty object (so Displace Coordinates>Object), which changes the lightning shape as it moves around, but making that empty a child of the lightning doesn't seem to instantiate it alongside the lightning particles (or it's not using the instanced empty for the instanced particles--they're using the original empty as the object for their displace modifiers).
I want to keyframe relative to each particle's creation time, not some fixed time on the timeline. As it stands the emitted particles/lightning "flash" correctly if they start on the first frame of the timeline, but once they're past the time when the default particle goes dark (about 30 frames in), any created particles start dark as well. I'm sure I could simply modify my parameters for the lightning to use scripting:
bolt_length = math.min(1, (#frame - #creation_frame)*0.1) - but I don't know what variables there are available indicating the time an object is created.
Can anyone help me with these?