Police lights flash patterns

Hello,

I am learning blueprint right now. I would like to create a realistic police light flash pattern. Here is a video for example:

I want to make a pattern that flashes 4 times before cycling over to the other side.

How can i achieve this effect?

Is anyone able to guide me as to how to set up what is needed in blueprint to tweak the values for flash frequency, flash intensity, and offset timing? This way, i can control and edit the rate of flash, how many time it flashes and the intensity of the flash?

Any help is appriecated.

1 Like

One way is using a material light function:

You set the intensity and other attributes in the light component.

Hope it helps.

3 Likes

Thank you for the great tutorial. I’m going to try this out if i can decipher your photo, lol. Do i turn any of them into float variables so it can be easily edited by adding this script to an actor?

Because I’m still new to this engine, I am hoping to apply this script to any surface LED lights on a vehicle model, give it emissive light materials and have it flash patterns.

Sorry, can you label your boxes in the photo so i know what am I searching for in blueprint?

Update above. Only named those that are different when searching.

The nodes above are from a material, not a blueprint. Then assigned it as light function on the respective spot actor component in the blueprint.

Also I used UE 5.2 with Substrate. If you are using earlier version of unreal you won’t find a node called Substrate Light Function. For earlier version you can read here: Light Functions | Unreal Engine 4.27 Documentation… everything else should be the same.

2 Likes

Okay, thank you for your time helping me out. I’ll go over this and see if I can figure it out. Stay tuned …

Awesome! Feel free to ask anything, I’ll try and help as best I can. It’s 3am for me so will be back in a few hours.

2 Likes

Figured it out thanks to your guide, it worked like a charm. Thank you again.

Now i have another challenge, just wanting to see if you’re able to make this light control go deeper …

The challenge is to make a flash pattern that flashes 4 times, and then a steady pause, before resetting the loop.

Here’s a video for example, the flash pattern above is the same flash pattern you see around the fire truck, it flashes 4 times fast following steady pause. Do you think this is possible?

Use timeline curves. Predefine as many various ones as you need, load them dynamically if necessary. A single timeline could drive a material with any desired intricacy and timing. Very flexible. But might be an overkill already.

This is using a timer with some random values, replace it with a timeline track. Color tracks preferably.


make this light control go deeper

Once you go deep with curves, you can go even deeper :swimming_man: :

2 Likes

Using the same material above, just play around with the scalar parameters of the material instance:
image

FlashPatternC

2 Likes

Awesome. Thank you for this suggestion. I’ll have to learn this whole system. Thanks for chiming in.

1 Like

You bet, thank you !

2 Likes