Something wrong with Enum ForEachLoop node

I have a modular character and I want to set the modular parts in runtime, so I created an enum named “BodyType”, and then made a BodyType-SkeletalMesh map to store the mesh info.


in my construct graph, I for loop the BodyType and can SetSkeletamMeshAsset like below:

My character’s left foot is missing like below:

Maybe my map data is wrong, I think and check, but the data is right.
Then, I changed to another way to achieve this:

The magic works, my character’s left foot come back now:

I guess there is something wrong with the ForEachBodyType node, maybe I was wrong, I don’t know, but the previous way is what I need in my project, please told me where I made mistakes, or how to avoid this bug, thank you so much!

Here is the test project and I posted to google driver:

Finally, I know why my footL is missing:
ForEachLoop node is good, switch node behaves unexpected.
if you add a debug point in the Return(FootL) node, it will be triggered only when body type equals to FootL, but if you continue to track the return value of FindMesh function, you will find that the return value of BodyType::Wing is FootL.
This is not expected in my case, I know this behaves simular to what c++ switch does, but not the same. Blueprint Switch node will continue to the next EnumType only when there is no excutable nodes after switch branch, this design is good to save your times in some cases, but not so good for enum switchment.
as we know, blueprint enum orderred by internal index which is generated when you click the add button in enum editor, this internal order is different to the display order in switch node if you move up and down when adding your enum types. In this case, keep switch branch blank will cause some expected returns.

So the final fix is simple, just add some empty return nodes in every switch branch, and make sure there is no empty switch branch in your code when switching enum types.