News › Forums › RAIN › General Discussion and Troubleshooting › Making AI use navmesh
Tagged: navMesh
This topic contains 12 replies, has 6 voices, and was last updated by jheysonlima 1 year, 8 months ago.
-
AuthorPosts
-
November 9, 2022 at 5:27 pm #5156
I’m just starting out using RAIN and I’ve already run into an issue. I can’t seem to get my AI to use the Navmesh. I have an AI that I want to move to a point and there is an obstacle in the way. I generated the navmesh the same as the tutorial video but my AI just keeps moving forward and bumps into the obstacle and never attempts to move around. My behavior tree is just a simple move node.
I’m sure there is something simple I’m doing wrong. Is there some setting I have to set so that my AI uses the navmesh?
November 9, 2022 at 5:59 pm #5157Does the NavMesh recognize the obstacle? Is there a hole in the NavMesh where the obstacle is?
November 9, 2022 at 6:06 pm #5158Yeah, here’s a screen shot of what I have. The lone cub is my AI.
November 10, 2022 at 8:15 pm #5178I also have the same problem. After uprage i can’t find how to make the AI use the NavMesh.
November 10, 2022 at 9:33 pm #5179I have two Objects.
1. Has Aspect Visual
2. Has simple BehaviourTree with detect, and move.Also RigidBody(with default configuration) Sphere Collider.
When collider has biger radious than 0.5 object don’t use navMesh.
Why ?I don’t have idea. Can anyone help ?November 11, 2022 at 5:21 pm #5194I have the same problem too… it was working fine before the update, now the AI ignores the navmesh and keeps hitting on the obstacles… the navmesh is right I guess, there are holes where the the obstacles are placed and it was working with the same settings before the update… I have also tried to change the walkable radius to higher and lower values but the problem still occurs…
November 11, 2022 at 6:12 pm #5196checking on it…
November 11, 2022 at 6:33 pm #5197I’m guessing that your AI is not “on” the navmesh. Making a larger sphere collider, or cube, or whatever is probably raising the transform of your AI more than step up height above the mesh.
Your body transform should always be at the ground point. If you are testing with basic Unity shapes, you should create an empty outer game object that represents the body. Put the shape inside your outer object and position things so that when the outer objects is on the ground, the bottom of the shape is also on the ground.
For example, a sphere with radius .5 has a transform .5 above the ground. The outer object will be at y = 0, but the child will be at y = .5. The AI will be created on the outer parent and will use that object as the Body.
November 11, 2022 at 7:45 pm #5209it worked for me… and yes, I am using basic unity shapes, what brings me another question, should I do the same thing if I were using a model from an fbx file? should I put the model inside an empty gameobject as well?
I hope it works for Kikrim and Destructicorn too!!!thank you prime!!!
November 11, 2022 at 8:23 pm #5211Thanks a lot of. This is the key to this problem.
November 11, 2022 at 8:35 pm #5212It depends on the model. Most of the models we use have their transform on the ground, so I rarely have to do something like that when working with imported fbxs.
November 11, 2022 at 8:42 pm #5215You might want to check out the Tutorials listed for Maya, 3ds Max and Blender by the Tornado Twins on the FPS Control project. The gist is to put the origin at the base so if / when you scale uniformly, the feet (of a humanoid character) remain on the ground. This should prevent animations from breaking due to problems of scale and fit along with what prime was saying.
-
http://www.fpscontrol.com/features
-
Scroll down to Basic Tutorial: 3D modeling for FPS Control
-
Hope that helps.November 12, 2022 at 1:07 am #5218thats a good tip!!! I used to put the pivot on the base of the model just to help me place the model on the ground, but I didnt realized that it helps while using different scale…
thank you Aaron and prime for the explanation!!! -
AuthorPosts
You must be logged in to reply to this topic.