Multiple actions for the same input based on the character used.

Hi, i’m making a game where the player can switch between 3 different phases. Each phase has it’s own skeletal mesh and use in the game. For example, phase 2 can only walk whilst phase 3 can walk and run.

I had 2 choices for this:
1- Have 3 different player character and possess them at runtime when desired.
2- Use the same blueprint for all 3 characters. I went for option 2 as it would be weird having to delete the current character and spawn a new one when changing phase.

My problem with this is that it’s complicated for inputs. For example, for an action, I need 3 different usage for the same action, based on the phase the player is using. I use an enum for this. And I use switch on Enum. The problem is, I need to plug this node on every action! I’m just at prototype state and my player character blueprint looks terribly messy.

Is there a way I could separate the actions? Like, use different controllers for the same character? I know it sounds weird, but I need help with that. Thanks you in advance.

  1. Create an Enumerator for Phase State (Phase 1, Phase 2, Phase 3).
  2. At phase change update the Phase State.
  3. Use a Phase State Switch for the input flow.

image

Yes, this is what i’m using, but I was wondering if there had any other solution. A cleaner one, where I could have 3 different blueprints using the same input action, but used for different actions.

Like having a Player_BP that would not be used and create 3 children blueprint from it. One called, Phase1, another one called Phase 2 and a third one called Phase3. Each of them having their own use for inputs

You can go that route. You just have to overwrite the different phase inputs.

Definitely have a parent class that’s fully loaded. All universal abilities, logic etc.
Create a Child class for each phase. Override the functionality as needed.

This is a lot more work than a flow controlled logic approach.

There’s also Actor Components.