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"

How can this test be returning false negatives?

Pairs of compared vectors that are identical sometimes fail the test when they should be passing it. How can this be, and how do I fix this?

alt text

Product Version: UE 4.8
Tags:
more ▼

asked Jan 13 '16 at 02:19 AM in Blueprint Scripting

avatar image

burnish5000
181 35 61 85

avatar image FiftyStars Jan 13 '16 at 08:29 AM

have you tried to add a breakpoint to your false branch?

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

2 answers: sort voted first

Vectors are floating point and VERY VERY precise (to 6-15 digits) so even the engine ticking and physics calculations make them != to eachother.

Split the vector struct (right click on it) and compare each axis (x,y,z or roll, pitch, yaw) with a nearly equal (float) node and use a tolerance to your likings.

Regards, Nsomnia -UnrealTek

more ▼

answered Jan 13 '16 at 04:55 PM

avatar image

Nsomnia
1.8k 67 27 137

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

Comparing float = float is unreliable, for instance, float1 can be 124.015455145 and float2 124.015455146.

You might want to use for this case a struct of Ints. Even something more reliable would be trigger boxes with Tags, so, entering on a trigger box you get its Tag and add to the visited blocks array and/or compare if the actor already has the Tag for that trigger box.

more ▼

answered Jan 13 '16 at 03:40 PM

avatar image

Trcioo
480 25 8 30

(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