# Police lights flash patterns

**URL:** <https://forums.unrealengine.com/t/police-lights-flash-patterns/1135372>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [April 21, 2023, 4:15am UTC](https://forums.unrealengine.com/t/police-lights-flash-patterns/1135372 "2023-04-21T04:15:08Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![403Rabbit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@403Rabbit](https://forums.unrealengine.com/u/403Rabbit)\
**Post date:** [April 21, 2023, 4:15am UTC](https://forums.unrealengine.com/t/police-lights-flash-patterns/1135372/1 "2023-04-21T04:15:08Z")

</div>

Hello,

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

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/8/c/f8c7feae0816e216132075475264a90722d90e84.jpeg "Flash Pattern: Whelen SlimLighter TIR6 Super-LED Light") ](https://www.youtube.com/watch?v=zeK6oIkvlYs)

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.

---

<div class="post-metadata">

**Author:** ![pezzott1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pezzott1/32/1215068_2.png) [@pezzott1](https://forums.unrealengine.com/u/pezzott1)\
**Post date:** [April 21, 2023, 5:54am UTC](https://forums.unrealengine.com/t/police-lights-flash-patterns/1135372/2 "2023-04-21T05:54:52Z")

</div>

One way is using a material light function:

- The material:  

- Gets this effect:  
 ![FlashPattern](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/1/8/b1871aae7abae748f9a5f958ee957512f6496258.gif)

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

Hope it helps.

---

<div class="post-metadata">

**Author:** ![403Rabbit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@403Rabbit](https://forums.unrealengine.com/u/403Rabbit)\
**Post date:** [April 21, 2023, 6:13am UTC](https://forums.unrealengine.com/t/police-lights-flash-patterns/1135372/3 "2023-04-21T06:13:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![403Rabbit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@403Rabbit](https://forums.unrealengine.com/u/403Rabbit)\
**Post date:** [April 21, 2023, 6:30am UTC](https://forums.unrealengine.com/t/police-lights-flash-patterns/1135372/4 "2023-04-21T06:30:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pezzott1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pezzott1/32/1215068_2.png) [@pezzott1](https://forums.unrealengine.com/u/pezzott1)\
**Post date:** [April 21, 2023, 6:36am UTC](https://forums.unrealengine.com/t/police-lights-flash-patterns/1135372/5 "2023-04-21T06:36:37Z")

</div>

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

> [@403Rabbit](#):
>
> Sorry, can you label your boxes in the photo so i know what am I searching for in blueprint?

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](https://www.youtube.com/watch?v=fKIfWF2mXxY). 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](https://docs.unrealengine.com/4.27/en-US/BuildingWorlds/LightingAndShadows/LightFunctions/#:~:text=Light%20Functions%20are%2C%20in%20essence,Color%20setting%20can%20do%20that)… everything else should be the same.

---

<div class="post-metadata">

**Author:** ![403Rabbit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@403Rabbit](https://forums.unrealengine.com/u/403Rabbit)\
**Post date:** [April 21, 2023, 6:44am UTC](https://forums.unrealengine.com/t/police-lights-flash-patterns/1135372/6 "2023-04-21T06:44:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pezzott1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pezzott1/32/1215068_2.png) [@pezzott1](https://forums.unrealengine.com/u/pezzott1)\
**Post date:** [April 21, 2023, 6:48am UTC](https://forums.unrealengine.com/t/police-lights-flash-patterns/1135372/7 "2023-04-21T06:48:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![403Rabbit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@403Rabbit](https://forums.unrealengine.com/u/403Rabbit)\
**Post date:** [April 21, 2023, 7:42am UTC](https://forums.unrealengine.com/t/police-lights-flash-patterns/1135372/8 "2023-04-21T07:42:41Z")

</div>

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?

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/d/2/2d20749c1d0f2d66524f490c30613fee7dfb7901.jpeg "LAFD \*NEW\* Engine 35 Responding") ](https://www.youtube.com/watch?v=gnVBoGqtkco)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 21, 2023, 8:57am UTC](https://forums.unrealengine.com/t/police-lights-flash-patterns/1135372/9 "2023-04-21T08:57:06Z")

</div>

> [@403Rabbit](#):
>
> The challenge is to make a flash pattern that flashes 4 times, and then a steady pause, before resetting the loop.

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._

> [@random flicker from Single Blueprint](https://forums.unrealengine.com/t/random-flicker-from-single-blueprint/479357/2):
>
> How about this snazzy Light Function? Material Actor with a light [[Image from Gyazo]](https://gyazo.com/6a6d9cc417dd5e6e8377c7bf2cba686a) It’s nice this way because when bulbs flicker it’s not really a sharp off/on. It’s a quick falloff transition and this is simulated here; and quite efficiently, too.

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 🏊‍♂️ :

> **[Curve Atlases in Unreal Engine Materials | Unreal Engine 5.7 Documentation |...](https://dev.epicgames.com/documentation/en-us/unreal-engine/curve-atlases-in-materials?application_version=4.27)**
>
> Curve Atlases in Unreal Engine store a combination of Curve assets that enables you to access Curve Linear Color data through your Materials.

---

<div class="post-metadata">

**Author:** ![pezzott1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pezzott1/32/1215068_2.png) [@pezzott1](https://forums.unrealengine.com/u/pezzott1)\
**Post date:** [April 21, 2023, 10:23am UTC](https://forums.unrealengine.com/t/police-lights-flash-patterns/1135372/10 "2023-04-21T10:23:54Z")

</div>

> [@403Rabbit](#):
>
> flashes 4 times fast following steady pause.

Using the same material above, just play around with the scalar parameters of the material instance:  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/f/1/ef1ae161f5e390578c72a4e397e1bcfff6d6f5ec.png)

![FlashPatternC](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/c/0/4c09f94c8a9568d61955696c67720889e1da6bdd.gif)

---

<div class="post-metadata">

**Author:** ![403Rabbit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@403Rabbit](https://forums.unrealengine.com/u/403Rabbit)\
**Post date:** [April 21, 2023, 5:20pm UTC](https://forums.unrealengine.com/t/police-lights-flash-patterns/1135372/11 "2023-04-21T17:20:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![403Rabbit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@403Rabbit](https://forums.unrealengine.com/u/403Rabbit)\
**Post date:** [April 21, 2023, 5:21pm UTC](https://forums.unrealengine.com/t/police-lights-flash-patterns/1135372/12 "2023-04-21T17:21:42Z")

</div>

You bet, thank you !
