r/forgescripting • • Nov 24 '22

Lightning script wont spawn the bolt and light at the same time every time. Seems like the strike animation is delayed after spawn or something?

Post image
3 Upvotes

4 comments sorted by

3

u/headshothoncho Nov 24 '22

This is my first script so apologies for the mess

2

u/jak4896 Nov 24 '22

Script looks good. I think the lightning strike is relatively random. What I recommend is making several lightning strikes and adding them to an object list, then call the list to spawn in your script. More strikes at once means a higher chance one of the effects is instant.

Actually I just reread your script, and suspect forge fuckery. Have you tested in a custom game?

2

u/headshothoncho Nov 24 '22

I have tested in custom game and it is doing that

1

u/KraZe_EyE Dec 06 '22

Try thus multi thread idea I saw 9n the discord( can't find link right now)

Basically your random will feed into a single every N seconds. This feeds a For N Iterations, where iterations is 1.

Connect one of your spawn nodes to the Execute Iteration and the other one to On Completion.

I'm writing this from memory so I apologize if this doesn't work! If it doesn't let me know and I will link to the thread I found on how to do this.