News Forums RAIN General Discussion and Troubleshooting Making AI use navmesh

Tagged: 

This topic contains 12 replies, has 6 voices, and was last updated by  jheysonlima 1 year, 8 months ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #5156

    Destructicorn
    Participant

    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?

    #5157

    Chris
    Participant

    Does the NavMesh recognize the obstacle? Is there a hole in the NavMesh where the obstacle is?

    #5158

    Destructicorn
    Participant

    Yeah, here’s a screen shot of what I have. The lone cub is my AI.

    Navmesh

    #5178

    kikrim
    Participant

    I also have the same problem. After uprage i can’t find how to make the AI use the NavMesh.

    #5179

    kikrim
    Participant

    I 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 ?

    #5194

    jheysonlima
    Participant

    I 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…

    #5196

    prime
    Keymaster

    checking on it…

    #5197

    prime
    Keymaster

    I’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.

    #5209

    jheysonlima
    Participant

    it 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!!!

    #5211

    kikrim
    Participant

    Thanks a lot of. This is the key to this problem.

    #5212

    prime
    Keymaster

    It 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.

    #5215

    Aaron Mueller
    Participant

    You 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. :)

    #5218

    jheysonlima
    Participant

    thats 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!!!

Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.