Im new to blueprinting/coding etc, and I’m trying something I thought would be fairly simple, a flickering light sequence. From off, flicker, to fully on. Ive got that far. Im stuck at adding variation to the other instanced blueprints in the scene.
I’d like varied delay at the start, and altering the float I have set to change the frequency of the light function. Obviously when I ‘alt+drag’ a copy, they all use the same pattern. I’ve tried making ‘child actors’ of the main blueprint, but when I add them in I get no light at all.
Not sure what else to try at the moment, feel like Ive scoured every inch of Google looking for answers. This is what I have so far in the event graph (its all set to trigger from sequencer)
so the ‘random number’ doesnt generate a new delay each time I start the event? Thats the logic I saw. event trigger → generate random delay → execute timelines
it will, the random number is a pure node so it gets called every execution.
timers are fine too its just yours arent set up correctly. You need to set timer in one function (say BeginPlay or StartTimer) and the red event is the TriggeredEvent so that starts your timeline.
So I have this tidied up version now, and it still seems to be working. How do I handle instances with variation of the delay and flicker. When I ‘alt+drag’ a copy, they use the same values.
Can I ask the same for how you would setup a staged delay for instanced copies too. ie. you walk into a room and the closest lights switch on first and then the next set etc. Or like runway lights. I feel Im going to use these 2 ideas, and the random switch-on a lot, so need to firgure this out.
I think the issue is you’re setting the parameters of a Material Parameter Collection. Collections are shared among all materials using them. Instead you should set the parameters on the instanced materials of the instanced objects (those are called Dynamic Material Instance or MID). Try using node “Set Scalar Parameter Value On Materials”, this is a boilerplate node that will automatically generate instanced materials (if necessary) on your object instance and set the values on that instance.
It was a tutorial I saw that said I needed to make those collections to be able to create events using them. I will try your method. I also dont think I have the setup right for the event on an ‘actor child’. Its running through the event straight away rather than when its triggered. How should this look to call the parent event at the trigger point on my sequencer?
thats all setup and working on a single blueprint, but if I ‘alt+drag’ copies, I get no event happening on them. I thought instances were supposed to play the same event, if nothing specific was setup for them.
Its part of a sequencer animation at the moment (for a cutscene), and about 30secs into the sequence. So I had added an event node into sequencer, added a keyframe where it should start, and changed the end-point to target my event. Begin play would be annoying if I wanted to retime stuff earlier in the sequence. (Id forget about it as its not on the timeline with everything else.)
Is there a better option for this? It would make it easier for me if I didnt have to add event tracks for each light
then the issue is likely that you’re only calling the event on the single instance, so wherever you call that you need to call it on all instances. im not sure how you’re referencing them at the moment but for example if youre using GetActorOfClass you need GetAllActorsOfClass
Could I add a ‘getallactors’ in the Director blueprint, instead of all these separate nodes? (these were created automatically when I added a keyframe onto the event track
I’ve worked out why my instances wernt working. I had this setup in the ‘level blueprint’. Which was working when it was only 1 blueprint, but making them all full brightness straight away when I had instances.
I assume it was playing the flicker effect before my camera got to that position. This is code I robbed from some random post. How do I change it to make my events only happen when theyre triggered. I assume I would want some events triggering earlier in the sequence, now I know what Im doing, so some sort of delay wouldnt work.