Announcement

Collapse
No announcement yet.

Changing the color of multiple lights with a trigger box (HELP!)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Changing the color of multiple lights with a trigger box (HELP!)

    I need help with my trigger box. When the player overlaps the box, All the lights in the Room turn a different color. How do I do that?

    #2
    Originally posted by Mrminecraftwizz1 View Post
    I need help with my trigger box. When the player overlaps the box, All the lights in the Room turn a different color. How do I do that?
    Easily.
    Create BP actor "light".
    Add custom event here "set random color" for example.
    In components of light actor, add light.
    In event drag reference to light component and there is probably function "set color".
    Make color from random numbers, i never did this but you may try to break linear color and set random value from 0 to 1 for each color channel (r g b)
    Then from somewhere, if you have stored array of lights or you can use "get all actors of class" node, for each loop and call event "set random color".

    Comment


      #3
      Let's assume you have a room with 3 lights inside it (just simple point lights, right?) and the trigger for example at the door.

      Let's say all these lights have white color (by default.)

      There are multiple ways to do this.

      The easiest is this :
      Go to the level blueprint, create an OnActorBeginOverlap event for the triggerbox (select the trigger in the viewport, go to the level bp, right click and type in beginoverlap.)

      Then check if the overlapped actor is the Player. You can do that by casting it to t the Player character. ( get player character, then drag out the blue pin and cast to "yourcharacter")

      Connect the exec pin from the begin overlap to the cast node.

      Create a reference to all three point lights in the viewport (the same way you did to the trigger)

      Then I believe there is a node called set color or something like that, drag out the blue pin from it and type in set color

      Connect all the blue pins to the set color node, connect the exec from the cast to the set color

      Pick a desired color from the set color node, and woalla, you are ready.
      Zombie Physics Hit Reaction: https://forums.unrealengine.com/comm...-dismemberment

      Advanced RPG Combat Template:https://www.unrealengine.com/marketp...ombat-template

      Comment


        #4
        thanks for the reply. I will try these and get back to you soon to say if it worked for me.

        Comment

        Working...
        X