Toggle Police Lights and Sirens

Hi Lee. I will try to make a video tutorial for you when i get home in a few hours.

Okay Hello!
My Name is Lee and i am a New ue4 developer :slight_smile: I am creating a Police Based game, i have vehicle models made with lightbars already on top of the car.
I would like to have Police Vehicles where i can press "G For lightbar toggle and H for siren toggle. If i want to do this does the lightbar have to be a seperate model, and how do i do the toggling. I am very confused and would love it if someone could give me a tutorial on how to do it

Okay thank you very much :slight_smile: If you tell me your youtube channel when its done ill check it out :slight_smile:

the light bar wouldnt need to be a different mesh, though you may want to have a separate material but its not necessary. to have the lights light up i would use a material scalar parameter, in the material you would have base texture color multiplied by the scalar parameter then plugged into the emissive. as for the toggling of the lights, you would just have a script in your vehicle that consists of: G input key event → flip flop → get material, set scalar parameter. for the sirens its pretty similar h input event then flip flop then the way you turn on and off sounds (dont remember the nodes for this off the top of my head). oh i guess i should explain a flip flop as well, its a node that switches its output each time its activated. so the first time its called its output A, then the next time its output B, then A again, then B, etc. its good for settings somethings state, like a switch.