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"

Please spot the flaw in my logic (random integer in range)

Hi all,

Have I made an glaring error here? Surely it should never hit the print string? I've been staring at this too long so perhaps I can no longer see the obvious!

alt text

Thanks, Sabre.

Product Version: UE 4.19
Tags:
unusuallogic.jpg (178.3 kB)
more ▼

asked Jun 22 '18 at 12:24 PM in Blueprint Scripting

avatar image

llll Sabre llll
30 1 2 5

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

1 answer: sort voted first

Every time you're checking that variable it's generating a new random integer. So it's a different number at every branch. Meaning it could be 0, 1, 2 at the last branch.

You should promote the result of Random Integer in Range to a local variable before the first branch. And then compare that variable, instead of the output of the random node.

more ▼

answered Jun 22 '18 at 12:48 PM

avatar image

Mosel3y
1.8k 49 20 67

avatar image llll Sabre llll Jun 22 '18 at 02:13 PM

Solved. Thanks Mosel3y! I had a feeling it was something I should have spotted!

(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