Multiple integer checks not working

Hey, I have an integer index that I’m incrementing and performing checks based off the value of the int.

if (Index == 1)
{

}

if (Index == 2)
{

}
etc.

The index is incrementing properly and each check works by itself but when there are two of these checks in the same function the 2nd wont work. If I replace one of the checks with a boolean the other integer check will work. I tried the index as a float but same issue and the index is not a local variable.
Any help is appreciated

Sorry for the awkward names I’m just testing things quickly. All of the Nams are montage section names. I looked at your message, looked back at the code and instantly saw it, the brackets before and after the second index. It’s working now but let me know if anything is off because I’ll be adding more conditions.


ok great thanks, first time seeing switches but makes a lot more sense.

FName Name = AnimInstance->Montage_GetCurrentSection();

The section is returned as an FName, is there a way to represent this differently.

int32 FName::Compare( const FName& Other ) const

This was the only other way i saw to reference the FName beyond the string.
There’s also

GetComparisonIndex();
GetDislpayIndex();