In the last part of the Animal AI, we created a behavior tree based AI controller for the crocodile to free roam and if an enemy/player is detected, it will start chasing the enemy/player character and if the target is within the reach, it will attack. Today, I am going to make the crocodile return to free roaming if it loose the sight of the target. But after losing the sight, it will not immediately return to free roam, it will still go to the last seen location and if player move more than 1000meters from the last seen location, it will register and the target is lost. Then only it will return to free roaming.
password=codelikeme_croco