How do I set up Avoidance Navigation for scary characters in UE4?
I'm seeing reference to "avoidance navigation" here and there. Is this about avoiding obstacles or other actors? I'm trying to figure out a way to make a character run away from other characters, ideally path finding out of the area containing the scary character without getting too close to it.
You have many options on how you can do that, it really is a matter of what else the characters need to do. If they are just going to run away and that's it you might just want to hard code that behavior on their AI Controller, on them being within range and sight of the scary character, test for that periodically within the tick function, pick a destination somewhere away from them and then call the move to on it.
If there is other behavior as well you really should spend the little bit of time and set up a system so you can add more behaviors easy, such as a behavior tree system. These items you mentioned would be in the tree as seperate nodes, sensing for the scary characters, finding a good location to flee too, then fleeing.
There is a lot of design in doing AI, UE4 provides behavior trees with a visual editor which makes it easy to try out changes once the system is setup. It will require some effort on your part to set it up. Check the forums for the threads on behavior trees, there are scattered instructions and suggestions only at this point. Epic is working on documentation but it hasn't been publized yet.
answered Apr 17 '14 at 04:59 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here