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"

Change light color to random color that constantly changes

I'm messing around in a little project and I am trying to do something with the global directional light. In the level blueprint, I am trying to constantly change the color of the light using an event tick. I just can't figure out how to make a randomly changing RBG variable. So it would go Event Tick -> Set Light Color (Target: Directional Light).

I assume I need to also do a Set color, so I made a LightColor variable. Kinda lost as to what I need to do. Any ideas?

Product Version: Not Selected
more ▼

asked Dec 03 '14 at 10:36 AM in Blueprint Scripting

avatar image

41 10 14 17

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

2 answers: sort voted first


Just saw this tutorial. You can just make a "Random Unit Vector", then convert it to LinearColor, and just set your light's color with the obtained LinearColor.

As described in the tutorial, you can set a timer to choose how often you want the color to be changed.

Hope it helps.

EDIT: Added a simple screenshot of the timer-based Blueprint, that can be found on the tutorial as well. Change color BP

more ▼

answered May 20 '15 at 01:07 PM

avatar image

16 1 5

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

You can call 3 different "Random float in range", ranging from 0 to 255, and right click on the "Color" Pin of the "Set light color" and split it into float, and then connect every random float to every float. That way, at every tick R will get a random from 0 to 255 and same for G and B. Well on the paper it works, but currently i can't get it working, the light always switch to white and nothing more. But give it a try, i may have missed something on my side

You may also replace float by integer, or clamp the float

more ▼

answered Mar 23 '15 at 04:08 PM

avatar image

178 13 16 21

(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