I have an NPC Blueprint Actor which I wish to debug, by directing Keyboard events. So I have set the Actor to Auto Receive Inputs (Player0) and enabled Input, via a Get Player Controller. See attached slide. But my Character still does not receive any Keyboard inputs.
I have tried different keys, in case another Actor has consumed that input. And I have placed my Actor into an empty scene. Still no keyboard inputs received. And yes I have clicked into the screen to ensure game is in focus. My Auto Possessed Pawn (Main Player) Character does receive all/any keyboard inputs.
I am stumped. I have seen similar queries on this, and believe I have followed the advise. Why is it not obvious.
I do not particularly want to direct All keyboard events via single Player controller BP, and then find/cast to each Actor within my game. That seems a bit messy too closely coupled.
i’m pretty sure only one actor can be possessed at a time.
you can have the player control dispatch events without knowing who is listening for them. Then the character can bind to those events. In that case then the character has to know about the player controller class, however there are ways to decouple if you really needed to (interfaces, an intermediate class, actor components).
To verify that only one character can be possessed, just remove the player character from scene temporarily and then see if input doesn’t register on the NPC.
1 Like
Yep I have my NPC under an AI Controller since it is automated motion, and my Main Character is a Possessed Pawn. And as you are stating only one character can be possessed by a Player controller at a time. I am just getting used to the Player Controller - Possessing only a single Actor at time thingy.
I tried your suggestion, and indeed removing the main player character, and setting my NPC as a possessed pawn, meant that it immediately received the keyboard events.
So I guess the conclusion is that, by default, we cannot have keyboard events distributed amongst more than One Actor. And I will have to create my own Player Controller, and raise events out as you suggest.