I have a quick question regarding blueprints and their control over objects in my level.
So basically I’m trying to create a series of lights that will fire (from 0 intensity to 5000 intensity back down to 0 intensity) one after another for the duration that the player is on the level.
I’ve created a basic class called LightBarSequential. I have 3 blueprint objects created from that type in the level.
In the level blueprint I have an array being populated from “get all actors of type” : LightBarSequential.
Now where I’ve struggled is at the point where I’m creating a delay within the ForEachLoop because the Delay node won’t work with that I’m trying to accomplish.
Is there a better way of doing than having the level blueprint populate the array, foreach loop, cast to SequentialLight, then modify the intensity?
Hello,
try , it may be what you want :
3 lights in a row in a blueprint, intensity set to 0, timelines keys are 0 s, 0 / 1,5 s, 5000 and the 3 “light” booleans are set to false. Finished timeline output goes back to branch input.
Thanks so much for your response! is one of the ways I thought about doing , the problem however is that I want to be able to build (programmatically, does term even apply with blueprints?) an array at the beginning of play that will populate all of my SequentialLight objects so that I don’t have to manually specify the lights like .
Sorry, i don’t understand your trouble. If you create " 3 lights in a row" blueprint, you’ll have all of them flickering on event begin play and you’ll can spawn as much as you want without nothing to do. I may have misunderstood.
Edit : And if for some reason you need an array, you create one with blueprint as variable from “get all actors”.
What about a way to have intensity phase on and off within the class BP and have it offset itself incrementally so just placing them in the level would include the phaseOn offset?
Maybe what you want is not a 3 in row 100 lights but a hundred lights flickering one after one. In that case, consider that after a delay the new light will be in phase with the first one and from there create a blueprint with one light with a vaiable for duration.
Forgive me for not being understanding what you mean (I’m still really new), can you explain what you mean by "after a delay the new light will be in phase with the first one and from there create a blueprint with one light with a vaiable for duration. "?
Based on blueprint but with one light :
On begin play :
Edit : i forgot level or light blueprint :
Level blueprint : Set an int “index” based on the “get all actors” “light blueprint” “find” array index
Light Blueprint : Set an int “SetDuration” from your “index” value like that for example :
if index+2/3 : division : remainder 0 then set duration 0
if index+1/3 : division : remainder 0 then set duration 3
if index/3 : division : remainder 0 then set duration 6
Or if you want the lights to light up as the player gets close to them, you can add a trigger volume to the Light Blueprint, so it turns on once the player is in range and turns off when they aren’t, with the range being fairly large so that multiple lights would be on at any given moment.
Is that the kind of effect you are looking for?
Oh yes, so one light of all is activated.
Then based on my last idea : simply use your index array value as delay.
In your level “on tick” event with a delay, loop and select index of your lights array and activate the timeline by a custom event in blueprint.
then you can do a reverse effect with a bool set true or false when index is 0 or last index and on true value = index and on false value = length - index or a second loop from max to 0.