Select node always calculates both inputs

http://puu.sh/jBGJh/ce5e2a5562.png

This results in a “Divide by zero” warning although it should only calculate second input pin since it’s set to true.

Hey John,

I don’t get a warning with this setup. Is this happening in any Blueprint type, or does it need to be a specific class? Is this Construction Script, Event Graph, or in a Function or a Macro? Is there anything else I need to do to get warning besides what’s shown in this image? Thanks!

Hi , you need to connect select node to something of course, like a “print string” node and this node needs to be exexuted. I used a regular function in a regular blueprint based on actor.

Ah, I see it now. It shows up in log during PIE; I thought you meant a compiler warning. Okay, checking against our internal builds, and I’ll let you know once I’ve entered a bug report. Thanks!

Thanks again, John. I’ve entered this as UE-20044 as it appears to occur in both 4.8.3 as well as our internal builds. I’ll post here when I see any update on it.

Hi , any updates?

It looks like a fix was created for Select node, but not yet integrated because it can’t be fixed by only changing Select implementation. It’s going to require a change in order of pure node execution that BP compiler uses.

Basically: progress, but no complete fix just yet. I’ll let you know if I see more.

is there more progess now? This happens in 4.10.1 to.

Yeah, this was very irritating since first time I realized it happens. Forced me to do many nasty exec spam routes to optimize out calculations. Would be nice to have it work

Check condition → evaluate appropriate pin, instead of current:
Evaluate everything → paste proper result.

Apologies; we have no update at this time.

Still happens in 4.13 as well. It is really annoyings since I use an array in select node, and when array is empty, I would like te do something else. Problem is, its still exucuting get on array even though it selects other input. Meaning it will just try and get a value from an empty array and throw a warning.

This makes select nodes useless in a lot of cases.

Here is a link to issue on our public tracker so you can keep up with its status: Unreal Engine Issues and Bug Tracker (UE-20044)

FYI, looks like this is apparently fixed in 4.16 issue link

No, it seems like it won’t be fixed anytime soon.

Source, comments for a very similar bug.

In 4.18 it still is an issue, at least after nativization.
Makes an otherwise handy node almost useless.

still an issue in 4.21, as I think that fixing this issue will really help in optimization… However, a simple workaround that I’ve thought of that we can use temporarily until this issue get fixed (It’s not perfect, but it works and saves space).

Is to create “Calculate?” boolean input in Function/Macro/CollapsedGraph… and feed it same boolean that we already use in the “Select Node”, to decide whether function should continue to calculate math in it or not.

images here will explain it better:

Hope it helps :slight_smile:

1 Like

Man, this is terrible. I figured this out today, and I am stunning, that this mean all my select nodes are executed on all pins. Select nodes are a very, very great tool to prevent a bis spaghetti BP code mix and minimizes copy ob nodes. But it’s a big problem when this means that all pins are executed. I often make calculations related to result of select.
Is there an official bug open for this? I can’t believe this is intention of select nodes. Because this make them useless for many cases.

1 Like

Throwing another message of distress related to that to eventually motivates epic into modifying this behavior …

Wish there wasn’t computation for non-selected variables.

1 Like