Select Float - Both A and B are evaluated?

Given this, in the level blueprint of a new empty project :

I get the divide by zero warning, which means both A and B have been evaluated, whereas only A should have been.

99091-selectfloat2.jpg

In an actual situation where MyArray length is exactly 1 :

This returns the divide by zero warning, but it shouldn’t do the more than 10 path…

This is not critical, but imagining a complex calculation going into the node, wouldn’t it be a waste of resources to have both calculated instead of only the necessary path?

Is that intended, or should it be reported as a bug?

It happens in both an existing project and an entirely empty one.

You should be able to reproduce by using the same graph as in my first screenshot in a clean new project.

In my existing project my array length is not null when it gives that error, but exactly one. However the calculation required when this array is bigger than X (X > 10, in my case) involves a division by (length - 1) - and thus the error.

Hi ,

I have not been able to reproduce this on my end with the information provided.

  • Does this occur in a clean, blank project with no additional content or is it limited to one project?
  • What steps can I take to reproduce this error on my end?
  • Have you tested the length of the array to see if it is populated before using select float? If it is -1 (NULL) you may be seeing a warning due to this.

I did some more digging and have found that this is a known issue, and is in our system as UE-22021. I have update the bug report to reflect that additional nodes are affected by this error.

Thank your for looking into it .
After a bit more experimentation I saw it happened both with the Select Int and the wildcard one as well, so it’s probably an issue with select nodes in general.

Has there been any more work towards this? It’s easy to work around, but it would be handy to have this “fixed.”

I find it easier to think of the node inputs as function parameters, and then it makes sense that they would need to be evaluated before entering the node.

Hey Rakosman,

Here’s a link to the issue on the public tracker so you can keep an eye on the status: Unreal Engine Issues and Bug Tracker (UE-22021)