Handling mutiple (gta-style) control schemes in realtime

Disclaimer: I’m a newb with UE4.
Preface: I’ve looked around for other threads regarding but couldn’t find anything.

tl;dr
Is it possible to swtich to/enable a control scheme when event X occurs (event X being something as simple as a context sensitive button press)? In an effor to keep the a) level blueprint and b) my character blueprint’s event graphs clean, I’d prefer not having to check the player’s state/mode (in car, on foot, etc.) with every press of a button.


Thanks to all the helpful people out there, I managed a control setup where the player can switch between 1st and 3rd person at any time, and the control scheme follows suit. Currently, is all located in the my character blueprint’s event graph, where I use branches to switch the controls based on a “mode” variable (currently toggled via button press) .

I want to add other control schemes like for commandeering different vehicles and such. The vehicles could/will have completely different control schemes. A simple example would be: spacebar makes a unicycle jump, makes a car brake, etc.

I expect can all be done in the same event graph (with all sorts of action inputs, and stuff), but I’m worried it’s gonna get unwieldy/messy and worse, might introduce a bit of lag as I have to do variable checks (i.e. if (controlmode == 1 then biped controls, if 2 then unicycle controls, etc.) on every button press.

Input nodes seem to be constantly running, even if they aren’t being used.

Would it be possible to use a blueprint interface or something similar to activate/deactivate event graphs (killing all the processes in the previous event graph after a control scheme switch)?

I don’t believe any of the default templates have any examples of (Vehicle is close, but it only has 2).

Might anyone have any recommendations or references?

Thanks in advance!

The best way to have multiple input schemes is putting them all into the character instead of the Controller.

Why? You have only one Controller per Level/Player and can/should not change it. So when the player enters a car, you let him possess the car which has it’s own inputs defined. You board a plane? It has it’s keys defined.

You can even go further and define some basic inputs in some “RootPawn” and let your various Chars extend from it. When you need to change inputs, you can easily override the parent’s inputs.

It is strongly recommended to use the InputMappings instead of direct key assignment, especially when you have multiple input styles.

I am personally using such a scheme in a MiniGame collection, where each level has it’s own unique inputs. In my case, even all the levels share the Controller.

, thank you very much for the response.

I sincerely appreciate the time you took to give a heads up.

  • best way to handle multiple input schemes is put them in the character, not controller
  • “strongly recommended to use the InputMappings instead of direct key assignment”

I take it the statements above mean I should
① use the Edit> Project Settings > Input screen to add InputMappings for all possible controls, and then
② define what each of those inputs do, inside the character blueprint’s event graph.

If so, I’m pretty sure is how I started off. I’m not quite sure what you meant by not putting the input schemes in the controller. I never knew you could put in a controller blueprint/event graph.

The following things I’ve never messed with, so I will research them:

  • Possessing actors or pawns
  • Defining inputs in a RootPawn (and have characters extend from it) ← seems to be the most difficult

I will post back (hopefully) with links to articles/tutorials that helped:

Thanks again, . Your hints are much appreciated.

Sorry for the delay.
Yes, you should use InputMappings. The positive side of is, that you can easily make your game compatible with multiple platforms and have multiple keys doing the same.

If you didn’t mess around with the PlayerController, I assume you did most of your stuff in the Character?

It’s actually really easy to extend from other Blueprints. You either choose them as parent when creating a new BP or you can even change it on your existing Character by selecting “Class settings” in the top menu of your BP and then change the “Parent Class” on the right side menu.

There is a nice example named “Child Blueprints” in the Content Examples project, it defines a basic “Pickup Object” blueprint and then adds child-blueprints which extends from Pickup.

Thank you, . No problem at all with the late reply.

Yes, I didn’t muck with the player controller, rather everything in the character’s event graph.

I just so happened to learn about using the Class settings tab to designate parent classes to inherent from in blueprints. I appreciate you citing that as an example.

I will refer to the “Child Blueprints” sample you referred me to.

Thanks again!