Is there a method I can use that will tell me if a path from one location to another is able to be traversed? I wish to call this method from a child of AAIController.
There is actually a really easy way to do this.
Use the “Find Path to Location Synchronously” (or path to actor if you are getting your path end location that way), than from the path data output you can use the “Is Valid” to get whether the path to that location is valid or not.
The Find Path to Location Synchronously is here: Find Path to Location Synchronously | Unreal Engine Documentation
If “Is Valid” doesn’t work for you out try using “Is Partial” node. This will return true is the path isn’t able to go all the way to the target location and false is it can (might be the other way around, just test it).
How ever this is a Blueprint example so I can’t be sure that this will be able to help you with you C++ issue
If you only want to know if it’s traversable and don’t need the path itself, you should use UNavigationSystem::TestPathSync. It will be a fair bit faster than FindPathSync.
You can get a pointer to the navigation system by calling
MyWorld->GetNavigationSystem() ;
@Kamrann Thanks. Is there anyway to get callbacks for events such as reaching the destination? Or do I have to check manually in tick?
See UPathFollowingComponent::OnMoveFinished
delegate.
Thanks a lot!