Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Toggle Police Lights and Sirens

Okay Hello! My Name is Lee and i am a New ue4 developer :) 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

Product Version: UE 4.20
more ▼

asked Sep 20 '18 at 11:11 AM in Using UE4

avatar image

1 1

avatar image ThompsonN13 Sep 20 '18 at 01:29 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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

more ▼

answered Sep 20 '18 at 11:14 AM

avatar image

95 7 11 11

avatar image DrNastyYT Sep 20 '18 at 12:10 PM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question