1

I have this extrude-loop in Simulation Nodes.

How can I restart it from scratch every 4th second like a lightning that spawns from the same spot every 4th second?

enter image description here

Manu Järvinen
  • 7,392
  • 2
  • 25
  • 62

2 Answers2

2

Chanfiroly's answer (at least as presented here ) won't work if the framerate multiplied by your desired bolt lifetime doesn't produce a whole number. For example:

  • 23.976 FPS animation will jump through the 4 second mark
  • a lifetime that isn't a whole number will be hard to hit exactly
  • even if at first the animation works, it can stop working after a longer time: A Shader Trick

So instead you should do this:

Markus von Broady
  • 36,563
  • 3
  • 30
  • 99
  • Wonderful! Even though, I replicated the network exactly. Why does it slow down from 60fps to even 20fps when one keeps playing the loop for 5000 frames? I can see in the spreadsheet that the vertices get resetted like they should.... weird – Manu Järvinen Jun 26 '23 at 12:42
  • Ah, yes, it's because cache keeps building up - makes sense. Most probably happens with every type of network, so, gotta live with it. Okay. Good. – Manu Järvinen Jun 26 '23 at 12:54
  • Would you know how to make the growth of the line gradually slow down during the 4 second-cycle, but still reset itself to grow full speed in the beginning of each cycle? The extrude-node's Offset Scale should be multiplied with 0.995 for every frame I think, but I can't get it to reset every 4 seconds... – Manu Järvinen Jun 26 '23 at 19:14
  • Ah! I think I got it :) I divided the result from Modulo by 8 and Subtracted it from 0.5 and put that into the Extrude Mesh's Offset Scale - Seems to work how I like it to work. – Manu Järvinen Jun 26 '23 at 19:28
  • @ManuJärvinen yep that's how I would do it. – Markus von Broady Jun 26 '23 at 19:28
0

Chanfiroly's answer seemed to work :)

enter image description here

Manu Järvinen
  • 7,392
  • 2
  • 25
  • 62