Unity's Input System
I am having some trouble with the new Unity input system. I have been working along with some friends and I don't know how I feel about it.
We were trying to make a gun shoot when the play pushes in a controllers right trigger but cant get the bullets to shoot when you push in the trigger only when you meet the time required for the hold interaction. I also am using a tap interaction and tried it with a press but it only let one of them work at a time. ( either hold or tap/press at the same time)
I feel like the old input system is so much easier to work with but feel in order to get local multiplayer or just a controller to work "easier" I would need to learn about the new input system.
How does everyone else feel about the input system? Is there a way to learn it easier since the documentation isn't the best or videos that have explained it well? Everything I saw covers the basics but never shows making a more serious game or going over other methods/ using interactions
About this post
- Posted
- Archived
- Score
- 2 · 67% up
- Kind
- Text
- ID
- l11hur
7 comments
Hope someone with experience answer here. I am in the same situation as you, I find the new input system too convoluted, for my simple games I am still attached to the good old 'Input.GetAxis()'
Yeah I definitely feel like they will move forward with trying to make the new input system their main source of input at some point in the future but they would definitely need to simplify it. The old input system is easy to use and works perfectly. I’ve just heard that the new system is easier for local multiplayer and controller support which are the reasons why I’m trying to learn it
I would help but i don't know C# only C++
I've been studying unity for a while, but I'm not sure what your problem is since I have no idea what kind of code you're writing.
Can you share the piece you're having trouble making work?
The code that I have goes like this.
Inside the awake function:
Methods that get called: private void StartRapidFire() {
Attack Script on the weapon that gets called:
Sorry if there's any formatting problems I'm fairly new at reddit and don't use it much so I'm not sure how to format things properly
Hey, it looks great, I don't think I could format it that well.
Sorry for the delay in answering.
I'll start by saying what you're doing there is very different from how I've seen/done things, so I'm not sure I can help, but I'll try.
Not sure if this is something that happened because of the editing of the post but here:
Also, you're not using the Update function?
I'm guessing this is what reads player input ?controls.PlayerBehaviour.Attack.performed
Also, why are you using a while with the waitforseconds there? Doesn't that lock you in the firing action? Though since it's a coroutine it might not, but did you try outside of a while to see if it doesn't fire with the press only?
Sorry for being so oblivious, I'm on the process of learning Unity and C# and figured, why not try to help.