Closed agent-q1 closed 4 years ago
Really surprised this wasn't noticed until now. The change definitely looks correct to me, this check incorrectly passes if the entity's position is more positive than the target's, which would be 1/8th of the time (in theory).
LGTM :+1:
@agent-q1 are the tests failing because of this change?
Nope @skaldarnar they're pre-existing or atleast that's what @Cervator told IIIRC. Should probably fix those tests some time
Bug Fix
Bug Fix in MoveToAction node that causes characters to remain dormant even when they haven't reached the destination.
Justification
The relevant part of code is supposed to check if the destination has been reached, and set the drive to 0, as well as return Behaviorstate.SUCCESS. However, just checking if the individual coordinates are lesser than distance (a constant set at 0.2f) is not enough. What if all the coordinates (of target direction) start out as negative negative?, Then it will always believe that the destination has been reached and never move, which is not the case.
Thus I believe, this should be changed as so.