Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: hoyoyo80 on February 24, 2019, 07:59:54 AM

Title: AI(navmesh agent) flee from player
Post by: hoyoyo80 on February 24, 2019, 07:59:54 AM
Hi all,


Im implementing an enemy type that will flee from player when player too close to them using navmesh.

For now, im multiplying player position vector3 with -1 on Z-axis. It works and the enemy move away from player direction but the problem now is, when i chase them to end/edge of navmesh they keep on trying to go to that direction.

Any help?

Thanks
Title: Re: AI(navmesh agent) flee from player
Post by: Athin on February 24, 2019, 06:14:21 PM
Hey there,

What do you intend to happen once the enemy hits the edge of the map? 
Title: Re: AI(navmesh agent) flee from player
Post by: hoyoyo80 on February 24, 2019, 10:49:38 PM
Manage to do it.. I just raycast the wall and random rotate more than 45 degres and continue move away from player position.

I hope there is a neat solution for this but for my game this is suffice.

Thanks for viewing.