i am currently playing around with AI controllers for my characters to build some NPCs, and i came across this tutorial here:
Currently my player characters are al built around the Enhanced Input system, and i really like the input options. Now my idea was, since all my chars are already built around Enhanced input, and move and do their stuff via those Enhanced inputs, why not use this same system and the same events for an AI?
However, the current AI controllers are not able to use that blueprint/code shown in the tutorial, something is missing in the AI controllers, that is present in the player controllers - something, that allows the player controller to actually use then Enhanced input system.
So my question is: Is there any way to … install… whatever a player controller have, that allows it to access the Enhanced Inputs in a regular AI controller?
So that i then can build NPCs that just inject commands and let the characters use the Enhanced Input events just like a regular player?
Or is there an other way for an AI controller to trigger the Enhanced input events in a character?
I’m having the same issue with a vehicle driving AI and I tried to use a player controller for AI movements. It still does not work because the “enhanced input local player subsystem” does not exist unless a player is controlling the playercontroller. If you’re trying to make a character walk around, you can use the “add movement input” for now.
I guess, the only way for now would be, to build and spawn the AIs like normal Players in the world, with a Player controller and a Player start. Then “just” create an extra Component, that does all the AI stuff, without being an actual regular AI component, and attach that to all “NPCs”.
This probably means, that i could not use any of the AI related stuff like Crowd or Detour or Navmeshes, until i figure out, how to create a Char, that can have a Player Controller and an AI controller at the same time, where the AI controller then injects all the Commands into the Player Controller with the Enhanced Input Component.
Come to think of it, maybe if i use a normal Pawn/Character, and attach that as a Child actor to an NPC Player Character (that uses a Player controller to get Enhanced Input) - then this Child actor would be able to possess an AI controller, while the Main NPC would be a player character, that just is not controlled by a human, and would just be like an AFK player in a multiplayer game (which gets overtaken by an attached AI Mindcontroller )