News › Forums › RAIN › General Discussion and Troubleshooting › Pathfinding problem
This topic contains 28 replies, has 3 voices, and was last updated by prime 1 month, 2 weeks ago.
-
AuthorPosts
-
May 27, 2022 at 2:13 pm #26074
Hello. I am testing a pathfinding. And in some cases solution can not be found. Unit uses BasicMotor without Face Target. It goes to static navigation target. In specific case (screen #1) navigator can not build the path (why?). But when the unit was shifted to the left (screen #2) then the navigator was able to build the path.
May 28, 2022 at 7:29 am #26137Another case.
May 28, 2022 at 7:35 am #26138Mesh parameters:
AI parameters:
May 28, 2022 at 9:35 am #26142I changed the Cell Size to 0.2 and it worked.
May 28, 2022 at 10:11 pm #26236This is awesome. Thanks for the detailed feedback. I know this will help others.
NOTE ON CELL SIZE: “The resolution of the Navigation Mesh in meters. The higher this value the more accurate the mesh is at small sizes, but the more memory and time it will take to generate. The resolution of your mesh can be calculated by the following equation: size * localScale.x * cellSize * size * localScale.z * cellSize.”
Another thing to consider, often times people will find when they select the navigation mesh they will see the character standing in an unmasked section where the navigation mesh didn’t cover, especially on rough terrain. It’s a good idea to mess with cell size and step height in these cases.
Glad to see you were able to work it out!
May 29, 2022 at 7:21 am #26265Thanks for the reply. But I don’t understand why your LPA was failed at this situation. May be it’s a bug in pathfinding algorithm?
May 29, 2022 at 7:40 am #26267It generates a more rough mesh with greater values of cell size.
May 29, 2022 at 8:12 am #26269It’s a good question Uservs. I don’t know. I would suggest emailing Jester for a more specific answer. I do know that it works (for me) to tweak cell settings to get better behavior.
May 29, 2022 at 8:27 am #26272Based on the formula it is possible to increase the resolution of the mesh size or increasing the local scale without changing the size of the cell. I increased the size of the mesh leaving the cell size equal 0,1. Possible solution but not obvious.
- This reply was modified 9 months ago by uservs.
May 29, 2022 at 9:55 am #26275I have a next problem. The unit is outside walkable area. It walks to target and stucks for unknown reason. In this case navigator cannot build the path.
- This reply was modified 9 months ago by uservs.
May 29, 2022 at 1:08 pm #26281It is probably a colliders radius tweaks. But is it possible to restore from this state? For example unit was dropped to unwalkable area. Can unit detect a nearest valid point and go to it?
- This reply was modified 9 months ago by uservs.
May 29, 2022 at 11:32 pm #26383If you fall off the navigation grid….hmmmm, I believe you would have to do a little work to get the character back on. Path finding and movement would likely fail.
You could search for the nearest point, like what you may have seen in the waypath network tutorials, but will then probably have to use Unity’s MoveTowards (http://docs.unity3d.com/ScriptReference/Vector3.MoveTowards.html) target and then allow RAIN navigator to take over again.
I know there was some discussion on this forum for support of off mesh linking but not sure when that will be implemented or if it would help in this case, though it seems to me that it could.
May 30, 2022 at 8:02 am #26402Some solution is to reset option Valid Path Required.
May 30, 2022 at 3:57 pm #26471Ah..did that work for you? If so that’s a great tip. Thanks uservs
May 30, 2022 at 5:31 pm #26474Yes, it works for me. May be a custom motor with raycasting is not a bad variant for this task.
-
AuthorPosts
You must be logged in to reply to this topic.