Combining two conditions

Hey, I´m pretty new to UE4.

I created a class blueprint with three red colored pointlights, two of them are surrounded by triggerboxes. When I get close to one of them and enter its triggerbox, the respective pointlight turns green. As a result of both pointlights being green I´d like to have the third one turning green as well. How do I need to set this up? And how would I need to do it, if it should only work in a specific order (first light 1, then light 2)?

Thanks in advance and best regards.

google for BOOLEAN ALGEBRA.

You have nodes: AND, OR, NOT, XOR , pick those binary versions.

First check if light color is equal some value (type == to get equal node, or just “equal”)
Do that for all lights.

Then light A and Light B result , and use branch node, there you have if its true or false.

Or you can use loop.

  • get all actors of class (select class of your lights).
  • then check if light color is equal to value you want.
  • every time its equal increase some integer counter variable
  • if that counter is >= 2 then light last one
1 Like

Well, which exact nodes do I need to plug into the Equal Boolean node? I´ve got now two OnComponentBeginOverlap (Trigger 1 & 2) plugged into two SetLightColor (Target Pointlight 1 or 2). These are both plugged into the Exec of a Branch and the EqualBoolean is connected to the Branch´s condition. The true Exec of the Branch is plugged into another SetLightColor for the third pointlight.

A screenshot would save so much time :slight_smile:

True! :slight_smile: Well that´s how it currently looks:

1 Like

You need to use 2 variables. One for Light1Green? and one for Light2Green? - and instead of using the == node, you need an AND node to check if they are both green.

This worked, thanks! And how would you set it up, if it should only work, if I toggle the lights in a specific order?

Or just use single INTEGER variable. Set it to 0 at start, then increase (+1) for every matching color. Then check if that integer is more than 2 or not.