Hi,
Just updated to UE 4.9 and I have a problem with casting int to byte & enum in bp.
TL;DR version: casting 0,1,2(int) to enum failed, and results of casting enum to int are 2,4,6(should be 0,1,2).
Detailed post:
As you can see in following pictures, I have a enum with 3 items.
And I’m casting random int to byte then enum to get a random item list.
First I was using old way, random generate an integer in range of 0~2.
result is like this:
enum casting failed except for Paper(2).
I cast & printed other enums and found that enum are cast to 2,4,6, not 0,1,2(I thought they would be).
Then I tried to random my integer within range of 1~3, but still no use:
So I multiply my int rand result with 2(so they would be 2,4,6) and still got wrong result.
int to byte conversion is even much weird in this case,
My enum is like this:
And bp setup. (This is captured with int x 2)
Can you help me with this issue? Thanks.