How can I do an ability based on what key was pressed with custom keybinds?

0 favourites
  • 2 posts
From the Asset Store
🙌 Ability Skill UI Sound Pack comes with 115 high-quality sound effects
  • So what I'm trying to do is this:

    set keybind for each ability to whatever key is desired > press key assigned to an ability > do action

    I'm having trouble setting this up because I want to have multiple different abilities, but I don't want to have a bunch of repeated code for every ability and its variants. Any ideas?

    Tagged:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Also, for more details:

    Currently I'm using a dictionary for storing keybinds. So I have ("UP":87) for up (87 is the key code for W).

    I use Keyboard > key code is down > Dictionary.Get("UP"). That goes for WASD and any abilities.

    That is the current setup.

    What I want is to have different ability slots. The player can equip any ability to any slot and when they press the button for that slot, the assigned action will occur.

    I'm looking for maybe a simpler/more elegant solution to my problem. I've got some ideas, but I wanted to see if anyone has a better solution.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)