Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

Product Version: UE 4.12
more ▼

asked Jul 28 '16 at 02:18 PM in Blueprint Scripting

avatar image

80 11 21 29

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

    10/4=2 and 2 as remainder. 

Similarly the modulo and divide node are linked to this.

 10/4 = 2
 10%4 = 2

 10/3 = 3
 10%3 = 1

 510/10 = 51
 510%10 = 0

Hope this makes it easier to understand.

more ▼

answered Jul 28 '16 at 02:21 PM

avatar image

2.7k 107 35 180

avatar image TheMrTorbi Jul 28 '16 at 02:32 PM

thank you so much :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question