Download

[4.17] PlayerController and Inputs

I know, I know. I’ve read so much on both here and on the Answer Hub, but it leads to more questions.

So I’m working on a system by which a player can use abilities to possess NPCs. Some of these will more just “control” the NPC remotely via menu, but I know of at least one ability that involves directly taking control of the pawn for a time to “become” that NPC.

I keep reading that PlayerController is not the place to set this up, and I’m not sure I understand exactly what is being said by that. My current iteration uses an interface, ControllableCharacter. My PlayerController then set ups the InputController with the appropriate input information, and calls functions in any character it is possessing (Which have to implement the interface), where the input logic actually lives (Not all possessable actors/NPC are humanoid, so the inputs react differently).

Is this not the logical way to set this up, or rather, why would PlayerController not be a viable use for this?

As a note and for detail, this is for a single player situation, no replication needed, or I would have looked into PlayerState a bit more.