Few questions about Unity's new Input System

Started by
0 comments, last by ethancodes 3 years, 6 months ago

Hi all! I'm working on a 2D platformer game and have a character that is able to do most basic moves, but I'm not really happy with my code. I recently found out about Unity's new Input System, so I followed their documentation and got it all set up. And then…. ran into a few questions. Some are flat out questions and some are me fishing for recommendations. So I'll list them out and if any one can answer all or some, I'd greatly appreciate it! Thanks!

  1. The unity docs say to use a PlayerInput component on your player character. This references the Input Action Asset, and allows you to set up a few specific settings yourself. However, all the tutorials I've found do not use this component. Is that because maybe it's fairly new? Or is it better for some reason to not use it?
  2. If I do use the PlayerInput component, should I utilize Unity Events or C# Events? Are there pro's and cons to each? Imo Unity Events seems easier to set up, but are there any draw backs, any limitations?
  3. With the InputActionAsset, is there a way to set up button combinations? Say I want a special attack to be triggered when both L1 and R1 are clicked simultaneously, can that be done with the InputActionAsset, or is it limited to one button inputs?
  4. Lastly, should I even be bothering to use the new Input System? My entire reason for it was because my player controller was essentially one large Update function, checking for multiple button presses and doing the actions accordingly. I looked for other ways of doing it that was a little more broken up and manageable as I start adding in more complex move sets, but everything kind of looked like a mess. I thought this may be better as we are able to break each action into a function and instead of checking every action every update, we only handle the ones that we are invoking with the event. However, I'm not extremely knowledgeable about events. Are there any downsides to this?

I know this is a lot of questions so I greatly appreciate anyone who is willing to take the time to answer or discuss the pros and cons and all that with me! Thanks much everyone!

This topic is closed to new replies.

Advertisement