Great solution! It may be niche, but I was facing exactly this problem too, working on a strategy game where units are arranged in squads. Your solution greatly helped me find my own workaround for this problem. Thank you very much! =)
You could get rid of the delay if you use a forloop with break and have it stop once it tests positive this would also mean you wouldnt need to compare multiple points.
@@TorQueMoD not sure what it's supposed to do, because no docs or description, but when I test it returns nearest point on navmesh, even if initial point is not in navmesh. But when I use high extent values like 10000, projected point is not nearest sometimes on some maps. Because of this it just teleports enemies randomly. Changed to 1000 looks like working for me without issues. I'm using c++ version of method, maybe it working differently, not sure.
@@SurviveOnlyStrongAfter more testing on my end, I don't believe the ProjectPointToNavigation works as well as my solution. For example, for my game Beast Mode, I want the AI to run away from the player, so I'm calculating the LookAtRotation between the AI and the player and then adding 180 to it to ensure I've got the correct facing (away from the player) and then getting the forward vector + 5000 units and grabbing a reachable point in radius from there. However, when the NPC is at the edge of the nav mesh, if I try to use the ProjectPointToNavigation node to get it to move back to within the nav mesh, it works, but it's completely random and not getting the closest point on the edge of the navmesh.
@@TorQueMoD well, I use ProjectPointToNavigation differently, i'm working on a top down project, where the player movement is done through the mouse click, and I use ProjectPointToNavigation, with a small query value, just for the boolean return value, to see if the player clicked on a "valid" location to move to.. I love the way you explain btw, good stuff..
Great solution!
It may be niche, but I was facing exactly this problem too, working on a strategy game where units are arranged in squads. Your solution greatly helped me find my own workaround for this problem.
Thank you very much! =)
You could get rid of the delay if you use a forloop with break and have it stop once it tests positive this would also mean you wouldnt need to compare multiple points.
Thanks a lot for the idea how to solve this issue!
Looks very useful. Thank you
Thank you very much!!!!
isn't ProjectPointToNavigation suppose to do just that?
I thought project point to navigation would only snap it down to the ground. Maybe I’m wrong? I didn’t really test it. Lol
@@TorQueMoD not sure what it's supposed to do, because no docs or description, but when I test it returns nearest point on navmesh, even if initial point is not in navmesh.
But when I use high extent values like 10000, projected point is not nearest sometimes on some maps. Because of this it just teleports enemies randomly.
Changed to 1000 looks like working for me without issues.
I'm using c++ version of method, maybe it working differently, not sure.
@@SurviveOnlyStrongAfter more testing on my end, I don't believe the ProjectPointToNavigation works as well as my solution. For example, for my game Beast Mode, I want the AI to run away from the player, so I'm calculating the LookAtRotation between the AI and the player and then adding 180 to it to ensure I've got the correct facing (away from the player) and then getting the forward vector + 5000 units and grabbing a reachable point in radius from there. However, when the NPC is at the edge of the nav mesh, if I try to use the ProjectPointToNavigation node to get it to move back to within the nav mesh, it works, but it's completely random and not getting the closest point on the edge of the navmesh.
@@TorQueMoD well, I use ProjectPointToNavigation differently, i'm working on a top down project, where the player movement is done through the mouse click, and I use ProjectPointToNavigation, with a small query value, just for the boolean return value, to see if the player clicked on a "valid" location to move to.. I love the way you explain btw, good stuff..
Great~
Bro did you play future cop lapd by chance?
You know I'm working on a spiritual successor right? Search L.A.P.D. 2195 :)