AI Cover

Okay so I removed that condition from code, additionally I opened up the demo scene and saw that there is a MoveTowardsLocation component attached to the cover point so I added one to mine. Everything seems to be working now, thanks
 
New problems here :( . The agent finds the covers and hides in them but now there are several more issues here:
1) the agent is facing the wrong way. In the screenshot below it should face the frustum gizmo, right?
1692025167612.png
2) sometimes when it reaches the cover point it starts to continuously rotate around instead of just settling down (I tried increasing the arrive distance of the agent and the distance variable on MoveTowards component but that didn't work)
3) when it sees an enemy it just runs out of the cover and starts chasing them instead of staying in cover and using the shooting frustum on the right side and that makes the cover useless.
 
1) the agent is facing the wrong way. In the screenshot below it should face the frustum gizmo, right?
The cover ability determines the direction that the character should face based on the cover point. Does it hit the correct cover point?

2) sometimes when it reaches the cover point it starts to continuously rotate around instead of just settling down (I tried increasing the arrive distance of the agent and the distance variable on MoveTowards component but that didn't work)
Try increasing the stopping distance on NavMeshAgent.

3) when it sees an enemy it just runs out of the cover and starts chasing them instead of staying in cover and using the shooting frustum on the right side and that makes the cover useless.
This is likely related to your behavior tree aborting the cover task. Try watching the tree to see what is triggering the abort.
 
Try increasing the stopping distance on NavMeshAgent.
Doesn't seem to help. You can see the whole setup in this video

This happens in some covers, others work as expected (almost)

Upd: I think it has something to do with the side that its approaching the cover, because when I put the agent from the other side sometimes he stands correctly. But other times it either jitters like in the video or logs "Look rotation viewing vector is zero" in console on line 418 in Cover.cs and just stands there facing the wrong way... 1692110677748.png
 
Last edited:
This is likely related to your behavior tree aborting the cover task. Try watching the tree to see what is triggering the abort.
Well, the TargetInSight turns true and that branch has an abort type of lower priority so it aborts the cover branch. I don't recall changing anything related to abort types so what's wrong here?
 
This is getting into a lot of detail and it's hard to debug without seeing how it works. If you can tell me how to reproduce the problem within the demo scene I will be able to help but it's really hard to debug over the forum. Having an example from the demo scene that I can reproduce is perfect. If you're not able to reproduce it from the demo scene then it's something specific related to your setup.
 
Top