Switch statement failed to match case for index property

So, I’ve figured this out, and I will take you through the whole process. But in case you want the simple answer and you know how to troubleshoot, what was leading to this particular message was a Select based on Int, which was provided from a find node, which sometimes sent -1.

So initially I added a print statement to every Switch node, and then discovered that two of them were being called every frame, and I disconnected those two, and still got the warning messages, so I knew that wasn’t it.

I then basically went poking around disconnecting various things throughout the different graphs (Ubergraph includes all nodes (non functions, not sure about macros) from ALL graphs. Before too long I was able to narrow it down to the main gameplay loop, and then to where the player controller was setting input data that was to be sent to the pawn.

I continued a pseudo-binary search until I narrowed it down to a particular macro (that was called a bunch of times in the set input data nodes) which was asking whether a particular input axis was found in a bindings map. The result of the find node was plugged in to a select node based on int, which led to the float value of the particular axis. Now, when the axis was not found in the binding map, it returned a -1 value which was not represented on the select node. So I just added 1 to the int value and bumped all of the values I had plugged in down one, problem solved.

7 Likes