Hi,
What is the best way in organizing multiple branches after each other? I’m aware that I can use boolean operations, but is there a better way of doing it?
Hi,
What is the best way in organizing multiple branches after each other? I’m aware that I can use boolean operations, but is there a better way of doing it?
Depending on how certain conditions relate to each other, perhaps using an Enumerator and a Switch statement might help make things more organized for you.
For example, you could have an Enum called EWeatherState that has the following entries:
Sunny
Cloudy
Raining
Snowing
Instead of having booleans like bSunny, bCloudy, bRaining, and bSnowing, you can use the Enum variable called EWeatherState and a switch statement to perform certain logic depending on the enum value.
And for something even more advanced that is using enumerators, you could look into [bitmasks][1]:
It would allow you to compare complex states. The above is false.
Also, take advantage of the boolean operations: AND, OR, XOR and so on… sometimes more convenient than cascading branches which quickly turns into a wire spaghetti in BPs.