Enhanced Input remapping keys - Unreal Engine 5 beginner tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ม.ค. 2025

ความคิดเห็น •

  • @DarkFenikk
    @DarkFenikk ปีที่แล้ว +4

    I dont know if that bis helpful to you but I suppose most Games persue a form of SaveGame for saving Input mappings throughout Multiple Sessions of the Game.
    In my mind you would basically Create a SaveGame called InputRemappings or something like that with an MapVariable of Type InputAction / Key.
    Each time a change in the Widget has been made it will be added to the SaveGame and Saved to the Slot.
    With that setup you can basically on Restart in Init get said SaveGame and Remap each Input Action to its according Key from the MapVariable which only holds the changed Input Actions.
    If the said SaveGame would be saved in a Folder in the Documents path which can be easily returned via UnrealEngine Functions one can also Save SaveGames and the Inputs even when the Game will be Reinstalled.
    So yes, each time you change an Action to a new Key just Save said Action and Key together in a Map Variable and Load them on Init/BeginPlay would be first approach

    • @LeafBranchGames
      @LeafBranchGames  ปีที่แล้ว +3

      You are quite possibly correct. That is the only approach I have discovered since the making of the video as well.

    • @BR1.618
      @BR1.618 6 หลายเดือนก่อน

      Since 5.3 you have the experimental user settings feature that auto saves the inputs into the save folder, Pyro Dev goes over it in his video.

  • @shotakhakhishvili8640
    @shotakhakhishvili8640 ปีที่แล้ว +1

    Heve been looking for this for a while. +1 sub from me!

  • @unrealdevop
    @unrealdevop 2 ปีที่แล้ว +6

    Great video, thanks for the insight. Seems odd that the Enhanced Input system doesn't seem to have a way to store the input changes to file automatically. I guess you could setup a save game object to store them in... but it would be really nice if you didn't need to do anything like that.

    • @LeafBranchGames
      @LeafBranchGames  2 ปีที่แล้ว +3

      Maybe. Doesn't feel like that would be the way it is handled. It must be something simple and straight forward I just overlooked.

    • @unrealdevop
      @unrealdevop 2 ปีที่แล้ว +1

      @@LeafBranchGames I'll be watching to see if you find a solution, thanks again for the video.

    • @LeafBranchGames
      @LeafBranchGames  2 ปีที่แล้ว +1

      @@unrealdevop 👍

    • @darktaco1238
      @darktaco1238 ปีที่แล้ว +1

      @@LeafBranchGames tried it today. still has not been fixed. maybe in 5.2. But until then sucks we really cant use this feature. :/

    • @LeafBranchGames
      @LeafBranchGames  ปีที่แล้ว +1

      @@darktaco1238 I am sure in time it will become easier and more accessible.

  • @noname_2108
    @noname_2108 8 หลายเดือนก่อน +1

    thanks, useful!

  • @thebombercaptain4726
    @thebombercaptain4726 ปีที่แล้ว +3

    Could it be possible for you to update this video? I'm trying to implement this, but I'm reaching a bunch of different problems.
    1. How do you set up the input mapping if it is a situation that it has multiple keys (for instance the move action has 4 different keys: W, A, S, and D).
    2. How do you dynamically switch it between the action mappings and key mappings throughout all of the different keys (switching from movement action keys to a jump action key and so-on)

    • @LeafBranchGames
      @LeafBranchGames  ปีที่แล้ว

      I will be revisiting this topic in the future for sure.

    • @PlaneShiftOfficial
      @PlaneShiftOfficial 4 วันที่ผ่านมา

      I have the same problem with the move. I have to remap the forward and backward keys which are modeled as an axis 1D key. There is a function called getplayermappingrows to get all the player mapping, but then how do I identify the forward mapping from the backward mapping as I see no float scale value in the player mapping structure

  • @momomadi2
    @momomadi2 2 ปีที่แล้ว +2

    thanks for this great tutorial-- can u make another tutorial for how to using this new system for making combos (holding key or using the same key 3 time doing new event or double clicking firing new event)

    • @LeafBranchGames
      @LeafBranchGames  2 ปีที่แล้ว

      Thank you. I explain how the input system works in more detail in this tutorial if that is the information you are after: th-cam.com/video/8GPoeNCR8t0/w-d-xo.html

    • @momomadi2
      @momomadi2 2 ปีที่แล้ว

      @@LeafBranchGames i think this is kinda what i needed - thanks alot

    • @zsolezk
      @zsolezk 2 ปีที่แล้ว

      @@LeafBranchGames This is great! Can you get into detail on how to capture combo inputs? Like something odd. I.e. I love how Tarkov uses scroll wheel on mouse and another key held down to adjust crouch height. But I have no idea how you would capture that combination while you are rebinding this through the standard UE widget you use in the example.

    • @LeafBranchGames
      @LeafBranchGames  2 ปีที่แล้ว +1

      @@zsolezk I have not been making enough projects with it yet to have a good sense of when and how I want to use things. Also I am not familiar with the control scheme of Escape from Tarkov. However, you could imagine this as a potential way to do things. Let us say when you hold key X, and together with that you want to adjust crouch height. So when you press X, you can add the context "height adjustment". With this context available, then moving mouse wheel it will change crouch height instead of its normal functionality. When X is released, you remove the context again and normal functionality is available. Is this the best way to do things? I don't know. Need to experiment more with it to get a better sense.

    • @zsolezk
      @zsolezk 2 ปีที่แล้ว

      @@LeafBranchGames thanks! I will play around more with this. 5.1 has this as final btw. Out of beta.

  • @disket8614
    @disket8614 3 หลายเดือนก่อน +1

    Unreal Engine 5.3.2
    Your approach works in a packaged version for me.
    Keys save while changing levels (but loads the default values when you launch the game). You need to save them and load when you start the game.
    Thank you for your video!

    • @LeafBranchGames
      @LeafBranchGames  3 หลายเดือนก่อน +1

      Thank for the feedback and sharing of information!

    • @disket8614
      @disket8614 3 หลายเดือนก่อน

      @@LeafBranchGames Actually that's the best video and the most simple implementation of remapping that I saw on the internet.
      About questions that some people have (may be it will help a little if you'll redo the video at the same direction):
      1. Instead of using one IA_Move I used IA_MoveBWD, IA_MoveFWD, IA_MoveLEFT, IA_MoveRIGHT (the only way I found when need to use more than one key for input action - just make more input actions)
      2. if you use modifiers not in input mapping like default but use it in input action then modifiers do not get overwritten! (The same for triggers I guess);
      It works for me. May be it need to be tested more before saying it so confident)
      Much love

    • @LeafBranchGames
      @LeafBranchGames  3 หลายเดือนก่อน

      @@disket8614 Thank you for the feedback and information. Yes, I likely will do a new and more informative version at some point to cover the weak points.

  • @johnfint5683
    @johnfint5683 2 ปีที่แล้ว +1

    Nice video,maybe you save keys to structure and load

    • @LeafBranchGames
      @LeafBranchGames  2 ปีที่แล้ว +1

      Possibly. It would be nice if there was a more convenient way to do it though. Like the normal input system.

  • @Luillopanto25
    @Luillopanto25 10 หลายเดือนก่อน

    You can actually save this using a save game blueprint to make it persist even on a packaged game.

  • @HiraethGame
    @HiraethGame ปีที่แล้ว

    Nice tutorial, easy to understand. Do you know now how to save?

    • @LeafBranchGames
      @LeafBranchGames  ปีที่แล้ว

      Thanks. It seems the best approach is to use save game.

  • @WolfgangKrauser1993
    @WolfgangKrauser1993 2 ปีที่แล้ว +2

    Nice tutorial! it helped me alot. Now I'm trying to figure out how to keep the triggers and the modifiers when mapping a new key D: can't find a blueprint function to do that

    • @LeafBranchGames
      @LeafBranchGames  2 ปีที่แล้ว

      Your input action can contain the modifiers and triggers you need.

    • @WolfgangKrauser1993
      @WolfgangKrauser1993 2 ปีที่แล้ว

      @@LeafBranchGames Yeah I tried setting those arrays (triggers and modifiers) manually but it didn't work D:

    • @LeafBranchGames
      @LeafBranchGames  2 ปีที่แล้ว

      @@WolfgangKrauser1993 As in it did not register inputs properly after a change?

    • @NyelleUnbroken
      @NyelleUnbroken 2 ปีที่แล้ว +2

      What I've found is...at construct make a variable to save the 'Enhanced Action Key' instead of 'key' and SAVE THAT instead
      Then during remapping instead of 'unmap key' and 'map key' do the following instead:
      Call 'ENHANCED ACTION KEY' you referenced earlier > break it
      then I suggest breaking player mappable options as well
      then create node 'make enhancedActionKeyMapping' and break 'Player Mappable Options' on the left side of the node
      >>>>>connect them, BUT replace the 'KEY' from the widget input and just replace that value

    • @alexstewartallred
      @alexstewartallred ปีที่แล้ว

      @@NyelleUnbroken Do you happen to have a screenshot of this? I think I have it, but I wanna make sure before I fubar any of my input mappings..

  • @gigasoftgaming
    @gigasoftgaming ปีที่แล้ว +2

    I got 3 Questions
    1) If you press I, the widget opens, is there a way to close it too so the widget doesn't show all the time after you initially press it?
    2) Is there an easy way to add more key bindings then jump? for example, crouch, use, shoot?
    3) Di you figure out the issue with packaging the game not remapping properly?
    This video is awesome and verry helpful :D

    • @LeafBranchGames
      @LeafBranchGames  ปีที่แล้ว +1

      You can change visibility settings on widgets if you like to. So if you want to hide it when pressing I again, or when releasing or whenever you want - you just change the visibility to "hidden" for example.
      To add more bindings you could go about adding more widgets with their own variables for those other keys, like in for example a vertical box.
      I have not had the time to revisit this yet about the packaged game, no.

  • @cgkrab
    @cgkrab ปีที่แล้ว +1

    Were you ever able to find an answer about saving persistent mappings in a packaged game? I haven't checked lately whether this works now in 5.1, but I imagine this should be a bug or oversight if persistent/saved mappings in packaged was a default behaviour for the old system.

    • @LeafBranchGames
      @LeafBranchGames  ปีที่แล้ว +1

      Have not had the time to spend on this topic quite yet no, I will be releasing some more detailed tutorials on the subject when I do.

    • @cgkrab
      @cgkrab ปีที่แล้ว

      @@LeafBranchGames Ok - thanks! I submitted a bug report so hopefully it will get picked up if enough people confirm it.

    • @LeafBranchGames
      @LeafBranchGames  ปีที่แล้ว

      @@cgkrab 👍

    • @skifter3943
      @skifter3943 ปีที่แล้ว +1

      Create a Save Game object and use it to save and hold the mappings between sessions. Make sure to load it and set the current mapping context in your game instance on initialization.

    • @cgkrab
      @cgkrab ปีที่แล้ว +1

      @@skifter3943 Yeah...I mean that is the way to do this given the current state - but I assumed this was a bug, since the remapping DOES save between PIE sessions (just not in packaged game).

  • @CRUMVIII
    @CRUMVIII ปีที่แล้ว +2

    Any idea how to get access to like any secondary key we assigned to the input mapping context? For example for jumping I got space bar and a gamepad button. But, I'm only able to show the space bar.

    • @LeafBranchGames
      @LeafBranchGames  ปีที่แล้ว +1

      Well, first of all you would have to figure out how would you display such a thing to the user. Some games uses something like 2-3 columns, one for each mapping. So in that case you would get all the keys connected to the context, loop on them and display each one to a separate widget column.

    • @CRUMVIII
      @CRUMVIII ปีที่แล้ว +1

      @@LeafBranchGames I've set up the two column UI parts already. It's the cycling through the found input action in said mapping context that's giving me issues. My attempts so far just has the UI have one input as correct but the other UI saying it's empty when the context does have twi keys assigned to that input.

  • @el_denari
    @el_denari ปีที่แล้ว +3

    IA_Move is the default input action and it has w a s d for fwd left bwd and right movement. How do I only remap specific keys?
    EDIT: Remapping movement keys also does not add the modifiers and messing up the direction

    • @Kanermi
      @Kanermi ปีที่แล้ว

      were you able to fix it?

  • @jaykrazetou369
    @jaykrazetou369 2 ปีที่แล้ว +3

    Nice Tuto, but when you Unmap Key, you loose all Triggers and Modifiers of old mapping.
    How could you keep these settings when you remap Action Key ?

    • @LeafBranchGames
      @LeafBranchGames  2 ปีที่แล้ว +1

      Triggers and modifiers likely have to be added again when remapping. I did not attempt these in my tests so I can not say for sure, but I can test it some further in the future.

    • @jaykrazetou369
      @jaykrazetou369 2 ปีที่แล้ว

      @@LeafBranchGames Yes, I work on this subject actually and I try two ways :
      1) Just modify the key on mapping action (without unmap/map)
      2) Save and reload triggers/modifiers after map unmap/map key
      To do that, I check Lyra game project, but they use too much C++ to do the remapping. Not easy 😕

    • @LeafBranchGames
      @LeafBranchGames  2 ปีที่แล้ว

      @@jaykrazetou369 Which way works the best?

    • @GamesByHyper
      @GamesByHyper ปีที่แล้ว +4

      1. Before you are mapping the key, save the EnhancedActionKeyMapping
      2. After you mapped the key (without any triggers, modifiers, etc.) break the created enhanced action key mapping
      3 find it in the mappings array
      4. Set the found array element on the found index, and remake the EnhancedActionKeyMapping with the old triggers and modifiers values but with the new action and key value.

    • @Jean_Mi
      @Jean_Mi ปีที่แล้ว

      @@GamesByHyper That's the right solution, and it works!
      Thanks

  • @gatOlegat
    @gatOlegat 8 หลายเดือนก่อน

    what if i don't have the same set of available outputs, after i broke the struct? 9:15? I don't have reference to action input specifically and a few more

    • @LeafBranchGames
      @LeafBranchGames  8 หลายเดือนก่อน

      As the engine version change, systems in the engine can be changing as well as the Epic team continues development and alters the functionality.

  • @thelostsoul9497
    @thelostsoul9497 หลายเดือนก่อน

    Hey! I followed your steps but some of the options are different in UE5.5 and the key cannot be changed in the Mapping Context. Could you show how it can be done in UE 5.5?

    • @LeafBranchGames
      @LeafBranchGames  หลายเดือนก่อน +1

      I can put it on my to do list.

    • @thelostsoul9497
      @thelostsoul9497 หลายเดือนก่อน

      @LeafBranchGames Thank you so much. I really need that

  • @wolfwirestudios
    @wolfwirestudios 8 หลายเดือนก่อน

    Mate, I made my game using traditional input system. I'm in post production, is it safe to switch to Enhanced Input now? I don't have a lot of key bindings just the common ones and a few more. I'm using 5.3.2 btw

  • @IsaacCode95
    @IsaacCode95 2 ปีที่แล้ว +2

    Great explanation, just found out your channel, you got a sub from me !, thank you for the tutorials.
    19:45 - you can report this bug, with a thorough explanation and they will probably fix it.

    • @LeafBranchGames
      @LeafBranchGames  2 ปีที่แล้ว

      Thank you very much for your support. Glad you found the channel. :)

  • @shirou0130
    @shirou0130 2 ปีที่แล้ว +7

    how to actually use this for input action that have multiple keys?

    • @disket8614
      @disket8614 3 หลายเดือนก่อน +1

      Instead of using one IA_Move I used IA_MoveBWD, IA_MoveFWD, IA_MoveLEFT, IA_MoveRIGHT.
      And if you use modifiers not in input mapping like default but use it in input action then modifiers do not get overwritten! (The same for triggers I guess)

  • @jaredmiller219
    @jaredmiller219 ปีที่แล้ว

    Good video, One question tho, let's say I also have specific Player Mappable Key Options for each Key Binding, how would I re-add those key options to that key I remapped after I change the keybind. For example: If my move forward button is "W", and I (just for an example), switch it to "P", I want "P" to now take on all of "W"s Player Mappable Key Options. What do I do about that?

    • @kevinsmith3348
      @kevinsmith3348 7 หลายเดือนก่อน +1

      You should be using the Enhanced Input Action not Keyboard 'key'. That way the remapping does the task. So you wouldn't say "On Keyboard Space do action". Instead you would say "On Enhanced Input Jump do action". For Forward you would use an Axis but it's the same concept.

  • @SurviveOnlyStrong
    @SurviveOnlyStrong ปีที่แล้ว

    Did Epic enhance capturing mouse up/down events using input key selector? Can't get it to work...

  • @Krazygamr
    @Krazygamr ปีที่แล้ว

    This method removes the toggle for player remappable binding. How do I preserve this?

  • @yuancui4305
    @yuancui4305 ปีที่แล้ว

    Nice video, a question though, I wonder how to remap IA_Movement input action which is by default movement binding and coming with multiple keys within the action?

    • @aoshinn
      @aoshinn 10 หลายเดือนก่อน +1

      Create a modifiers array variable and try to compare it with the modifiers from the loop. Also check if it's a game pad, keyboard or mouse button (3 different functions that can be called from the key at the loop section).

  • @Punisher1992
    @Punisher1992 2 ปีที่แล้ว

    what would be the best way to implement an cooldown system? inside the nehanced input system? Now i made branches delays and bools for it, but i was hoping easier would be to get it somehow from the input itself?

    • @LeafBranchGames
      @LeafBranchGames  2 ปีที่แล้ว

      Delays are almost always a terrible approach for any kind of logic. There are very few times when a delay is useful without causing more problems down the line.
      What you want to do is likely create classes for whatever it is you want to have cooldowns for, and let those classes be in charge of their cooldowns. Inputs and enhanced inputs are completely separate from cooldowns.

    • @Punisher1992
      @Punisher1992 2 ปีที่แล้ว

      @@LeafBranchGames is there a way without c++? like could i make a CD component that counts elapsed gametime or something and attach it to the Cooldown actor?

    • @LeafBranchGames
      @LeafBranchGames  2 ปีที่แล้ว

      @@Punisher1992 Definitely it is possible. I even showed it done in my multiplayer ability tutorial series. It is super simple. All you have to do is use something like a timer, which I show in many of my tutorials, among them my "Create an RPG" series. That gives you complete control to do things like increase/decrease cooldown during it and everything.

    • @UnsealedWings
      @UnsealedWings 2 ปีที่แล้ว

      That's not true? Delays only cause problems if you don't account for them or use them improperly, which is about every node in Unreal. If you want a cooldown for something, Set Timer By Event or Function. make the code that resets your ability, run the timer to the event or set the function name if it's Set Timer By Function, then the duration of the timer is the cooldown timer, at which I would promote the timer to a variable, then you can call Invalidate Timer from that variable and stop the timer at any point. Even set a variable for the timers Duration and you can update the cooldown time ingame. if you wanna run it to a widget to display the timer in game as an icon or bar, you can Get the timer in the widget blueprint and from your player reference and you can Get Time Elapsed and Get Time Remaining. That should be everything you need to set up a cooldown. Hope this helps.

    • @Punisher1992
      @Punisher1992 2 ปีที่แล้ว

      @@UnsealedWings i made a cooldown system in c++ but i did it as a actor component... so i have to create child bp for every ability, and add it to the actor component section... dont know if its a good way, i mean it looks clean...

  • @nemo_met8491
    @nemo_met8491 9 หลายเดือนก่อน

    So have this bug been fixed?

    • @LeafBranchGames
      @LeafBranchGames  9 หลายเดือนก่อน

      It would seem it is not so much a bug as something you need to work around. By for example saving down your settings to file.

  • @eltwinscodm625
    @eltwinscodm625 ปีที่แล้ว

    Plz how to make moveforward or backward

    • @LeafBranchGames
      @LeafBranchGames  ปีที่แล้ว

      Could you elaborate?

    • @eltwinscodm625
      @eltwinscodm625 ปีที่แล้ว +1

      @@LeafBranchGames I made the jump like a video and i understand it . but when i do the same with IA-move .its always move left . how make it to move right or Forward or backward. maybe we want to add modifiers on it . but how

    • @LeafBranchGames
      @LeafBranchGames  ปีที่แล้ว +1

      @@eltwinscodm625 Sounds like the video you want to watch is this one: th-cam.com/video/8GPoeNCR8t0/w-d-xo.html

    • @eltwinscodm625
      @eltwinscodm625 ปีที่แล้ว

      @@LeafBranchGames okay ❤️‍🔥

    • @eltwinscodm625
      @eltwinscodm625 ปีที่แล้ว

      @@LeafBranchGames can you explain how use player mappable input action 😊

  • @50shadesofskittles9
    @50shadesofskittles9 2 ปีที่แล้ว

    I don't understand why you would want to do this over the standard way of adding inputs?

    • @LeafBranchGames
      @LeafBranchGames  2 ปีที่แล้ว

      I have another tutorial on the specific subject of enhanced input here: th-cam.com/video/8GPoeNCR8t0/w-d-xo.html
      which shows some of the differences, use cases and such.

    • @lpnp9477
      @lpnp9477 2 ปีที่แล้ว +2

      Say you want to make a marketplace game template but you don't want your end user to have to create a new project to get the proper keymappings for your game style. With Enhanced Input, you can create a set of keymappings as an asset and package that with your game template, so when your buyer adds your asset pack to their current game they already have the proper inputs set up - no need to change their project mappings aside from enabling enhanced input as a plugin.

    • @LeafBranchGames
      @LeafBranchGames  2 ปีที่แล้ว +2

      @@lpnp9477 That is a good point. Thank you for sharing.

    • @Athasin
      @Athasin 2 ปีที่แล้ว +4

      Think about how easy it is to change controls when a player is walking, swimming, driving or riding a horse. With enhanced inputs all you have to do is make a walking mapping context, swimming mapping context, a driving mapping context, and a horse riding mapping context and then swap the mapping context types whenever the player is doing either activity.

  • @MCxFATIGUE
    @MCxFATIGUE 5 หลายเดือนก่อน

    I just went through this whole tutorial just for you to tell me at the end that it won't work in a packaged game. Kind of pointless without that lol...

    • @LeafBranchGames
      @LeafBranchGames  5 หลายเดือนก่อน

      You could just use a save game slot to save the information to work around it.

  • @xdragon5502
    @xdragon5502 ปีที่แล้ว

    how to remap the movement keys?

    • @Kanermi
      @Kanermi ปีที่แล้ว

      Did you make it?

    • @disket8614
      @disket8614 3 หลายเดือนก่อน

      Instead of using one IA_Move I used IA_MoveBWD, IA_MoveFWD, IA_MoveLEFT, IA_MoveRIGHT.
      And if you use modifiers not in input mapping like default but use it in input action then modifiers do not get overwritten! (The same for triggers I guess)