wexam
New vMember
Posts: 13
|
Post by wexam on Apr 13, 2020 14:16:37 GMT
Hi! I don't understand why ai do not avoid colliders, only at the edge of a floor? this won't work in a landscape scene. All my ai, companion ai is stuck everywhere! or are this behavior not implemented in the fsm ai template? Layers are in default on colliders. Here is a screenshot from Invector fsm ai spawner Scene, ai is stuck on the collider
Ai avoiding the edge without collider Or have i missed something here ?
|
|
|
Post by Invector on Apr 13, 2020 18:03:52 GMT
Obstable avoidance is done via Layers, make sure you assign the layer of your obstacle in the AI Controller inspector > Detection > Obstacles Layer
You also need to limit the navmesh area to within your colliders, otherwise, the agent could get a destination to a point outside our colliders
|
|
wexam
New vMember
Posts: 13
|
Post by wexam on Apr 14, 2020 16:12:05 GMT
Yes i can't see this detection layer have an effect on the ai you still have to bake every obstacle with navmesh obstacle right?
|
|
|
Post by Invector on Apr 15, 2020 15:59:31 GMT
Yes, I think the NavMesh needs the mesh renderer visible in order to bake the obstacles, you can turn on the mesh renderer, bake, and turn off again
|
|
wexam
New vMember
Posts: 13
|
Post by wexam on Apr 16, 2020 9:48:14 GMT
Thank you sir, i think this would be a good addition to your ai template to actually have an avoidance behavior.
|
|
|
Post by Invector on Apr 16, 2020 12:39:10 GMT
Thank you sir, i think this would be a good addition to your ai template to actually have an avoidance behavior. The Unity Navmesh does provide a pretty solid obstacle avoidance, you can even have paths with priority. For ex: A Bridge and a lava floor, the first priority will be the bridge but if the bridge is broken the AI will run through the lava which is the secondary in the priority order.
|
|