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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Checking for Int never returns true

alt text

So, i am trying to setup a patroling enemy with blueprints, which stops at the last targetpoint. I already got patroling enemys which work just perfect. The function is almost the same as the permanent patrol. The difference ist the part after checking if patrolindex <= the Array lenght of the patrolpoints. If the last point isn't reached the index gets increased by 1 and the function gets called again. If its the same or greater than the Array lenght i want to set the bool Quest Complete to true, so the function stops looping and sets the bool Oger Quest Check Dist to true. I really dont understand why the check of Patrol Point Index never returns true. Hopefully you can help my. Thanks Marogaz

Product Version: UE 4.17
screen.png (108.5 kB)
more ▼

asked Jul 05 '18 at 07:20 PM in Blueprint Scripting

avatar image


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

1 answer: sort voted first

It is because your branch checks for pess than or equal to the last index (length - 1) of the patrol points. that means the False branch only happens when the index is MORE than the last index of the patrol points, which cannot happen unpess you increased it to be out of range which would cause errors on your Get node on the left side. try changing it to a < (less than) instead of a

remember an array of size 3 will have indexes 0, 1, and 2. So length - 1 equals 2.

more ▼

answered Jul 05 '18 at 08:14 PM

avatar image

3.8k 18 20 20

avatar image mightyenigma Jul 05 '18 at 08:16 PM

My mistake - i misunderstood you to mean that it never reaches the False branch.

avatar image mightyenigma Jul 05 '18 at 08:18 PM

Why are you setting index back to zero right after ++ ? why not just set it straight to zero without ++ ? I think you should remove the set index to zero.

(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