Ive got the AI following my character pretty well but once i stop the AI character strafes around my character. I couldn't find the code to modify so the AI companion would stop and go through a set of selected Idles.
I wanted to create an NPC that would follow the player relaxed and only turn aggressive when an enemy is detected.
Thanks for your quick reply, on the AICompanion script, I noticed that there are keyboard commands for the alpha keys 1 -4 which cycles the AICompanion into different modes. Using the keys I've been able to set it to go to an object, however, I can't seem to get the companion to go through the Patrol nodes. I know the Companion State needs to be set to "none" which triggers the error: AICompanion Cant find the (blank), the default variable Player is not set. This will also throw an exception with the error AICompanion Tag: is not defined. However, these are the prerequisites for the companion to be set as "Patrolling".
So can I simply add another keycode alpha 5 and set companion to companionState = CompanionState.none so the companion goes through the Patrol mode?
Sorry just seems there was a lot of special features in the companion script that could lead to very interesting ideas like coop or a party system eventually. Just needed a bone to find the right way to do it.
Hmmm good observation, actually we didn't code the companion to go though patrol nodes, those are used for enemies that are already patroling. I can take a look into this, it shoudn't be hard to implement this feature
V2.0 update: Just in case someone wants to set the companion to now patrol a path, simply create a path and assign this to your companion AI script and set the Companion state to none. Just make sure you bake a navmesh on the terrain and your companion will go her merry way and even fight any enemy encountered. Oh and make sure you're quite a distance from the companion or she will start strafing around you. I've disabled the Who's you target "Player" tag and simply renamed it to "Player2" to avoid this. Hope this helps someone else.
My CompanionAI is not receiving any damage from EnemyAI, but he's beating the shit out of enemy easily :P what could be possibly went wrong. i have added the tags in the meleemanager nd tags to detect to CompanionAI. The Enemy is attacking the companion but not causing any dmage to him. Enemy is causing damage to only me. Plz help anyone.