Hi!
Where do I have to add the mapping context? In the Player Controller? In the player’s character?
Thanks!
Hi!
Where do I have to add the mapping context? In the Player Controller? In the player’s character?
Thanks!
Either place is fine, it depends on how you want to control your characters.
We set it up only in the PlayerController, the player controller gets the inputs, then relays them to any controlled characters or vehicles, who all implement a controllable Interface.
So for example, the PlayerController gets “MoveLeft” triggers, then it relays MoveLeft to whatever it is controlling, and anything that implements the controllable interface has MoveLeft functionality.
But setting a different control scheme up in each character type is also a valid way to do it.
So, if I set it up only in the Player Controller, code like this:
Should be done in Player Controller, isn’t it?
Thanks!
I’m not sure because I don’t use blueprints. But where to do it shouldn’t be too different .![]()
In C++ it is usually in the function PlayerController::SetupInputComponent()