x

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"

Sometimes blueprint branch fails to recognize true case

Sometimes my blueprint branch fails to recognize the true case, and instead returns false. The first image below shows the branches. The final false should never be reached as the second image shows it is always fed an integer from 0 to 2, but the print statement is still reached sometimes. I can fix the problem by feeding the false of the last branch into the true of the first branch, but that does not seem like an optimal solution. alt text alt text

Product Version: UE 4.9
Tags:
unreal_probs1.png (141.7 kB)
unreal_probs2.png (45.3 kB)
more ▼

asked Nov 05 '15 at 03:56 AM in Blueprint Scripting

avatar image

HsoulT
3 1 2 5

avatar image kubiknubik Nov 05 '15 at 12:05 PM

When this prints that it's not int , what is value of the random integer. ?

avatar image HsoulT Nov 05 '15 at 03:44 PM

It varies from 0-2, so it can fail with any int.

avatar image kubiknubik Nov 05 '15 at 05:49 PM

May it only fails on 2 or 1, just print value of the random int when it fails.

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

1 answer: sort voted first

Hi man , its not a bug.

Every time your Branch get the int , he access the Random generator and every time get another int.

Here , i access the same Node:Random int in range, and pass it to the graph. I just access the same pin , but that pin is not a variable, neither a local variable, is a connection with a nod. and the node release a random int.

so asking to print the same pin, you will get always a random int. so to fix this, just assign the random int to a variable(or a local variable), and compare that.

random int.jpg (225.4 kB)
more ▼

answered Nov 05 '15 at 04:13 PM

avatar image

Est_engine
1.2k 58 12 62

avatar image HsoulT Nov 05 '15 at 05:49 PM

Thanks, I didn't even think of that! Works perfectly now.

(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