Check if Integer is a number like 10, 30, 1000, 1230
Hey guys i have a blueprint where i want to set toggle a boss text above the actor when the level is like 10 or 100 or 510, so there is a 0 at the end. How do i find this out so i can set it as a boolean.
Thanks for the answers guys.
asked Jul 28 '16 at 02:18 PM in Blueprint Scripting
Use the modulo node.
LevelNumber % 10 == 0
The % is the modulo operator, your modulo node. Take the level number, send it through the modulo node and check if the result is 0. If it is the number has a 0 at the end.
To explain how it works:
Remember back in primary when you was taught to divide for the first time you did not care about decimals? You were counting remainders.
Similarly the modulo and divide node are linked to this.
Hope this makes it easier to understand.
Follow this question
Once you sign in you will be able to subscribe for any updates here