How can I get an AI character to ignore my player pawn (vehicle)?

I have an AI character that will try to go through my main player vehicle if the vehicle is exactly in the way of its path. What would be a good solution for this? I’ve tried turning on RVO avoidance on the AI character, but it only avoids other AI characters, it doesn’t avoid the vehicle. I’ve also turned on RVO avoidance on the vehicle as well but it makes it look like the vehicle is avoiding the AI character, not vice versa. I’ve also tried turning on Can Ever Affect Navigation on the vehicle but it doesn’t affect the NavMesh at all, I’ve even got Rebuild At Runtime for the NavMesh turned on.

Having runtime navmesh generation enabled and CanEverAffectNavigation set to true should be enough in most cases. I suggest you played around with your car’s static mesh’s collision settings. Also, I’d suggest marking said static mesh as navigation’s “dynamic obstacle” (this can be done via Static Mesh editor). One more thing, there have been a lot of improvements done in this regards for UE4 4.7 so maybe try using 4.7 preview build :smiley:

Cheers,

–mieszko

Hey Mieszko,

Thanks for the reply! I’ve actually got a slightly different situation now, with the same problem… So I finally got your suggestion working, but turning on runtime navmesh generation makes the game drop 30fps. Unless there is a way to optimize that, I don’t think we will be building the navmesh at runtime anymore. So now my problem is that I need the AI to avoid my player pawn either without modifying the navmesh or modifying only a selected portion of it given the events of the game. Do you happen to have a solution in mind?

Thank you for the quick reply!

You need to look for information on optimizing navmesh generation towards runtime performance. There should be a lot of it on the internet (look both for UE4 and Recast information). I’ve shared some of my experience-based knowledge on this UE4 twitch stream. Play around with what you find and get back to me if you need more help. Also, sharing more info on your setup would be helpful. A stripped down version of your project or a new, little project exhibiting same issues would be perfect!