Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting bRecalcPathOnDestinationChanged to true on the BTTask_FlyTo node causes the task to always fail #9

Closed
OregonJunco opened this issue Jan 23, 2018 · 1 comment

Comments

@OregonJunco
Copy link

Hi, folks! This is a very cool plugin, and just what I've needed for the project I'm working on.

One quick thing I've noticed is that ticking the bRecalcPathOnDestinationChanged bool on the BTTask_FlyTo behavior tree node causes the node to immediately and repeatedly fail. It looks like the bit where it's checking the current target against the RecalculatePathTolerance,

if (!myMemory->TargetLocation.Equals(flightDestination, RecalculatePathTolerance))

is using Unreal's float == Vector operator, which tests whether every component of the flightDestination FVector is equal to the tolerance. If I'm not mistaken, this will only return true if the destination happens to be {X=RecalculatePathTolerance, Y=RecalculatePathTolerance, Z=RecalculatePathTolerance}; should this be an original vs new distance check?

Thanks again for creating and supporting this plugin; I'm having a great time with it!

@OregonJunco
Copy link
Author

Okay, whoops, I misread which Equals operator was being used; it looks like it's doing the one where it checks whether the difference between every component of TargetLocation and flightDestination is <= RecalculatePathTolerance. A distance-squared check might still make more sense than checking each component individually, but the code as written should totally work.

My bad!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant