How to use Unity's Input System

Поделиться
HTML-код
  • Опубликовано: 18 дек 2024

Комментарии • 264

  • @Dailyfiver
    @Dailyfiver 3 года назад +126

    Seriously these input tutorials are the highest quality I have seen on youtube. Blowing my mind with how clear everything is to me now!

    • @samyam
      @samyam  3 года назад +9

      Thanks again 😆

    • @MLaurenavicius
      @MLaurenavicius 2 года назад +4

      I share the same opinion and I've watched 300+ tutorials

  • @alexleonardkrea
    @alexleonardkrea Год назад +8

    I have seen a lot of input system tutorials but this tutorial is by far the best overview I have seen. You did a really good job showing all the options available and laid out your opinions very well on each of them.
    Thank you for putting in the time to make this! It will be my new go-to-video suggestion for people learning the new input system.

  • @maazadnan8550
    @maazadnan8550 2 года назад +16

    I would like to tell you that these are amazing, while almost every other youtuber simply goes through the process of setting it up and using different unity components, you actually explain them and the logic behind each and every thing, thank you!

    • @samyam
      @samyam  2 года назад +1

      Thanks! 😁

  • @ultimatesin3544
    @ultimatesin3544 2 года назад +18

    I gotta say, thank you so much for your indepth tutorial that covers all avenues of implementation instead of the typical narrow "quickest route".. so nice to finally see a unity dev who understands SOLID and access modifiers and why public methods should be minimized. Coming from other platforms I'm kinda surprised the lack of comprehensive docs for alot of Unity stuff, anyway your tutorials are great!

    • @samyam
      @samyam  2 года назад

      Thanks! Glad you found it useful! :)

    • @abdoreda7126
      @abdoreda7126 Год назад

      Exactly! you took the words right out of my mouth!

  • @justincarlson4057
    @justincarlson4057 2 года назад +2

    thank you for this. ive watched other input system explanations but they often dont go over the full options of implementation (im taught how to use component but not how to get constant values from it directly) and so i was left using a weird combination of the generated class and the component since i was only shown a how to do certain things using certain ways.
    Also i appreciate explaining that one can make input action variable to avoid typing strings constantly and risking mistyping. Now I know to look for ways to avoid that not just with this, but with all my code.
    great tutorial overall and very well organized and explained.

  • @facejets
    @facejets 3 года назад +11

    I often get a lot out of train-of-thought type of follow-along stuff in unity, but I'm six minutes in and subscribed, and a little bit excited. It's not just the organization; your voice carries my attention, which I really need for topics like this

    • @samyam
      @samyam  3 года назад +3

      Thanks so much! Very glad you enjoyed the video, lots more on the channel and coming up! :D

    • @TheAgavi
      @TheAgavi 2 года назад +1

      @@samyam I just want to second this. So many youtube tutorials are all over the place but you really went step by step. This video was a godsend. Subbed.

    • @samyam
      @samyam  2 года назад

      So happy to hear thank you!! 😄

  • @EfrainJMDev
    @EfrainJMDev 2 года назад +1

    I have given a chance to the new input system multiple times but I always rejected it because other tutorials made it look very complicated, I'm finally using it thanks to you!

  • @gilireeves4956
    @gilireeves4956 Год назад +1

    This video is so good! You explain the system so well and go over everything important, but you don't overexplain. I keep coming back to the video every time I need to set an input system for a game to remind myself how to do it and it always clears up everything.

  • @chunkyquail
    @chunkyquail 3 года назад +1

    The most comprehensive tutorial on the "New" Input system. Thanks.

    • @samyam
      @samyam  3 года назад

      Yay! Thanks 😁

  • @Coouge
    @Coouge 2 года назад +1

    @19:48 I'm confused. You mentioned you recommend using Invoke Unity Events but then you said you don't recommend doing it.

  • @codersexpo1580
    @codersexpo1580 2 года назад +3

    Just a small note here: @6:06 for WASD, NOTE: "When adding a composite, only ones compatible with the value type of the current action are shown. This will, for example, no longer display a 2D Vector composite as an option on a floating-point button action". To show the 2D vector composite just change the action type to "value" and the control type to "Vector2". Now the 2D vector composite option will appear. So @5:45 that's a very important step.

  • @mellaytheghost
    @mellaytheghost 2 года назад +1

    Took so long for me to find a video that made sense, thank you!

  • @dmtuan
    @dmtuan 3 года назад +1

    The bit near the end about InputAction & InputActionReference is the interesting part :D.. I can see this integrating into many scenarios well. Thanks for the video

  • @dongminkim8100
    @dongminkim8100 3 года назад +1

    This is extremely helpful lol. I had seizure from TL;DR syndrome when I tried to go through the manual by myself. Thanks

  • @alexocaber
    @alexocaber 2 года назад +2

    This was incredible thank you so much with your help I was able to overcome a problem that I had been stuck on for 3 days, and I really struggled elsewhere and with the documentation as well, thank you so much!!!

    • @samyam
      @samyam  2 года назад

      Glad to hear!! 😁

  • @basavarajguled848
    @basavarajguled848 10 месяцев назад

    this is the best tutorial to know everything with new input system, thank you so much for creating such wonderful tutorial

  • @Dr2quan
    @Dr2quan 2 года назад +3

    This is very useful even for VR, the XR Interactive Toolkit takes a very similar approach as the Input System(I just looked up: the XR Interactive Toolkit depend on the Input System), all the knowledge fits nicely in VR, the action based controller, input action, binding, several different ways to get the user input in code. Appreciate your sharing. Thanks.

  • @despia5274
    @despia5274 2 года назад

    I've been confused in adapting new Input system since I'm a beginner in Unity, but this video helped me so much. Thanks a lot!

  • @filipezanella825
    @filipezanella825 8 месяцев назад

    I confess I'm impressed. this video is great and explain everything really well.

  • @GrievousFlame
    @GrievousFlame 3 года назад +3

    Awesome video, the input system has some great features but its presentation is very confusing, you've made it much easier to understand how it can be used, thanks!

    • @samyam
      @samyam  3 года назад

      Glad you enjoyed the video!

  • @atomiz2002
    @atomiz2002 2 года назад +4

    you should be getting paid for teaching so thoroughly i cant imagine the amount of preparation it requires to simplify so clearly all the information for the learners
    (and i thought brackeys was the best tutorial creator out there even though his tutorials are kinda outdated now but guess who im switching to nowww)
    p.s. the amount of side videos linked to this one is incredible

  • @creationsmaxo
    @creationsmaxo 2 года назад +2

    Great video!
    The one thing that makes Control Scheme such a great part of the Input System is its implemented listening & switch option.
    Let's say that you want to allow the player to use either a Mouse and/or just a Keyboard or a Controller. Obviously, the kind of inputs will varies where one scheme might requires a press of a button to initiate the use of another input and so on so, originally, you mostly had to add some sort of full-time listener to any action of any device "not in use" so that you can apply some kind of switch as to what the player uses in case he or she decide to change which control to use mid-game.
    For example, let's say that you have a zoom function in a isometric-viewer Action RPG that allows the player to zoom in and out. On Mouse & Keyboard, simply scrolling the mouse wheel does the trick and, in case someone prefer to player using only a keyboard, it's fairly simple to add additional binding to some Numpad keys. But what about the controller? What if, to zoom in and out, the player has to toggle the zoom-in-out prior and after zooming with something like the right stick as, otherwise, the left stick is used to aiming?
    This is where the Input System does a really good job because its gives many ways of "knowing" and handling what is going on instead of just attempting at reading every small possibilities out of the players' reach.

  • @Brioshie
    @Brioshie 2 года назад

    This is very very helpful. The new Input system felt needlessly complicated to me

  • @MiniatureGiantsGameDev
    @MiniatureGiantsGameDev 2 года назад +1

    immediate, easy, answer for something I was overcomplicating loads - Keyboard.current.etc.....subscribed :)

    • @samyam
      @samyam  2 года назад

      Thanks! :)

  • @CymbalMonkey
    @CymbalMonkey 3 года назад +1

    Happened to stumble on this video, going through checking out to resolve an input error. This is a very informative video, really clear and I will definitely be coming back when I need to set up input. I subbed because of this. Thanks for the video : ]

    • @samyam
      @samyam  3 года назад

      Thanks so much!

  • @tarekmustafa2525
    @tarekmustafa2525 2 года назад

    Best video about the input system I found do far! Well done!

  • @panupongkaewsamer6637
    @panupongkaewsamer6637 3 года назад +2

    You are good teacher for Unity engine

    • @samyam
      @samyam  3 года назад

      Thank you :)

  • @jamesnguyen3459
    @jamesnguyen3459 2 года назад

    a very good tutorial. I'm learning Input System for VR and you made this so clear

  • @ciixo8510
    @ciixo8510 3 года назад +5

    Best channel on covering unity's input system! One question i had tho, how can we get a hold functions duration to use it on something like ui, the callbackcontext has a duration value but it doesn't seem to be registering correctly while holding down the key, it would be a great thing to cover on a seperate video!

    • @samyam
      @samyam  3 года назад +5

      Thank you!! If you have an interaction you can get the completion percentage with action.GetTimeoutCompletionPercentage()
      already have a video on that ;)
      14:57
      ruclips.net/video/rMlcwtoui4I/видео.html

  • @zakjj2233
    @zakjj2233 2 года назад +1

    god damn, thanks girl, this is the best tutorial out there

  • @ChronikSpartan
    @ChronikSpartan Год назад

    Unbelievably helpful as always!

  • @Jumph96
    @Jumph96 Год назад

    Thanks so much for making this video, I've heard about this new Input system but was hesitant to jump to it as I'm already struggling with lots of other parts of the game I'm making, but you've helped me understand why and how it can help me down the line especially when it comes to allowing the player to rebing actions. Once again, thank you so much for also going really in depth and show us all the different ways you can use/create an Input Action asset 👍. You just gained a new Subscriber 😃

  • @rasi123ful
    @rasi123ful 2 года назад

    Thank you so much for all these tutorials bro. So much valuable knowledge

  • @how-to-make-a-game
    @how-to-make-a-game 9 месяцев назад

    WOW SUCH DETAILS AT SPECIFIC TOPIC , GREAAAAAAAAAAAAAAT!!

  • @denn501
    @denn501 11 месяцев назад

    Many thanks!! Now my player scripts are looking nice and tidy :D

  • @bernharddoesuxinmedtech6548
    @bernharddoesuxinmedtech6548 2 года назад +1

    Outstanding, I tried a different tutorial first, was still confused. Your's was exactly what I needed, many thanks. As soon as Patreon offers a reasonable way to create a receipt for the inputs, my company will join! And yes, I tried ko-fi, but PayPal didn't work 😞

    • @samyam
      @samyam  2 года назад +1

      Thank you so much I appreciate it!! I also have RUclips memberships available, although the perks are a tad different than Patreon because I can’t redistribute files easily yet.

    • @bernharddoesuxinmedtech6548
      @bernharddoesuxinmedtech6548 2 года назад +1

      @@samyam Paypal worked this morning, so you should have received a few well deserved coffees via ko-fi 😀

  • @robosergTV
    @robosergTV 3 года назад +2

    Please now make vids about the new Ui Builder, you covered the new input system amazingly!

    • @samyam
      @samyam  3 года назад

      It's on my list! Thank you :)

  • @the_timme
    @the_timme 2 года назад

    Great tutorial, covered everything i needed and more! Also i like the way you say 'buddons'.

  • @salimnihat6966
    @salimnihat6966 2 года назад

    Thats the way of showing how to use something good job ! Loved it

  • @hunterxgirl
    @hunterxgirl 2 года назад

    This saved me a lot of time and many cups of coffee

  • @lilSapphireFox
    @lilSapphireFox 3 года назад +5

    I started to scream when you used the update function. Good thing you saved it :D I have been working with unity for over 3years now and I think I use Update in maybe 3 or 4 of my hundreds of classes, and only with an if statement. it's really usually unecesarry to check something every frame...

  • @imnot_RAUL.28
    @imnot_RAUL.28 2 года назад

    Thank you for tNice tutorials, tNice tutorials was a huge help.

  • @jessestewart5109
    @jessestewart5109 2 года назад +1

    I got super confused around 20:30 when you started commenting out a lot of code to use the PlayerInput, then uncommented it. Definitely a high quality tutorial, I just couldn't follow along, unfortunately.

    • @samyam
      @samyam  2 года назад +1

      Apologies, will keep this in mind for future videos :)

  • @ZenryokuFGC
    @ZenryokuFGC 2 года назад

    consistently clear and helpful videos, thanks so much!

  • @londonh
    @londonh 2 года назад

    Incredible tutorial! You are an amazing teacher, thank you so much!

  • @mislavpozek4269
    @mislavpozek4269 3 года назад +3

    Awesome video, best one on the topic i've seen, thank you
    Personally i prefer to use the input action references; my reasoning being that you shouldn't hardcode a string that can be easily changed by someone in the editor

    • @samyam
      @samyam  3 года назад +1

      That's true, to each their own!

  • @tobias-stein
    @tobias-stein 2 года назад

    Very smooth to digest your input, thanks for the content :)

  • @ericwoll
    @ericwoll 3 года назад +2

    Excellent video. Awesome confusing bug I came across was that on input action asset that you can create from the player input component I couldn't see any input devices. For whatever reason it worked fine when I created my own control scheme, but not with the generated or "No Control Schemes". Seems to work fine in this video.

    • @samyam
      @samyam  3 года назад +2

      Thanks! Sometimes the system can be a bit buggy, perhaps upgrading to a preview version may help with some of the bugs :)

  • @nanyubusnis9397
    @nanyubusnis9397 Год назад

    4:05 Do keyboard&mouse count as 1 input device?

  • @just_rogers
    @just_rogers 2 года назад

    This is a great tutorial! Very helpful, Thank You!

  • @mostafakamal6996
    @mostafakamal6996 2 года назад

    Thanks a lot ... it is helping in real time game dev...

  • @hassamlayachi351
    @hassamlayachi351 2 года назад

    God, I'm glad I found your video that helped me

  • @parcell-komunika3069
    @parcell-komunika3069 2 года назад

    Ima download it thanks for sharing!!

  • @ОлегМашков-я8х
    @ОлегМашков-я8х Год назад

    Вы прекрасны! Самый лучший урок!!!

  • @-.._.-_...-_.._-..__..._.-.-.-
    @-.._.-_...-_.._-..__..._.-.-.- 3 года назад +2

    Thank you so much! This is easily the most clear and concise tutorial out there.

    • @samyam
      @samyam  3 года назад +2

      Thanks :)

  • @Challseus
    @Challseus 2 года назад

    This is really, really good god damned content 💪. Thanks for putting it together!

  • @MatthiasTTV
    @MatthiasTTV 2 года назад +1

    Great content on your channel, you have a new subscriber! But here I got completely lost when you were explaining the recommended way of PlayerInput--you said the problem with UnityEvents is that it combines all the phases (started/performed/canceled) into one, but then when you showed the PlayerInput you just showed ReadValue and not how to access the different phases. So I'm still not really sure how to call different functions when different buttons are pressed. Do I have to read all the actions like "Jump", "Explosion", etc. all in the Start function and call functions accordingly?

  • @6TDOW66
    @6TDOW66 2 года назад

    Lifesaver. Thank you!

  • @chrisheld8463
    @chrisheld8463 2 года назад

    Excellent tutorial. Simple & informative. Well done :)

    • @samyam
      @samyam  2 года назад

      Thank you!

  • @hubbubbobbin
    @hubbubbobbin Год назад

    Thank you for the video!

  • @abdoreda7126
    @abdoreda7126 Год назад

    This is such a good video, thank you so much

  • @andreluizbrazil
    @andreluizbrazil 2 года назад

    Thanks samyam, for this excellent video :)

  • @jacksteege5091
    @jacksteege5091 2 года назад

    Great video full of information. Thank you!

  • @morningstar7071
    @morningstar7071 3 года назад +1

    best tutorial doesn't exi---

  • @alessandronardi4201
    @alessandronardi4201 2 года назад

    thank you very much you solved my problems

  • @rohigheeindustries4697
    @rohigheeindustries4697 2 года назад

    It worked. Thanks a lot

  • @hamzahumayun2200
    @hamzahumayun2200 2 года назад

    This is great, thank you!

  • @smallflyDE
    @smallflyDE 2 года назад

    Very good tutorial! Thank you very much for the explanation of the new input system! For me personally the video had a bit too much content (luxury problem). I wanted to quickly understand the best practice on how to work with the new input system (which you explained). But instead of telling only the best way, then say good bye and refer to another video for more (unnecessary but interesting topics regarding the new input system), you mixed all into one video. Nevertheless you covered also the recommended way and thus its fine for me. The rest I tried to ignore ;-)

    • @samyam
      @samyam  2 года назад

      Thanks for the tip! I’ll keep that in mind :)

  • @tmate88-j8y
    @tmate88-j8y Год назад

    Your tutorials on the Input System are fantastic! What are you using for VS Code extensions? I can't never install one that give me a list of properties that are accessible and the autosuggest/complete for anything is a nightmare.

  • @cahydra
    @cahydra 2 года назад

    Thanks samyam :D

  • @FromNorthProjekt
    @FromNorthProjekt 3 года назад +4

    keep it up ❤️

    • @samyam
      @samyam  3 года назад

      Thank you!

  • @cade5792
    @cade5792 Год назад

    Great tutorial!

  • @s.w.e.d.3057
    @s.w.e.d.3057 3 года назад +2

    mobile inputs, like holding and dragging would be a great video idea

    • @samyam
      @samyam  3 года назад +2

      Thanks for your input! I'll keep it in mind. I've made some videos on Touch, Swipe, and Pinch; here's my Input Touch playlist
      ruclips.net/p/PLKUARkaoYQT1Xwd9Az_cx-YbdvdUDNN5I

    • @s.w.e.d.3057
      @s.w.e.d.3057 3 года назад

      @@samyam nice amazing.! Thanks a ton and I would love to ask u some stuff on unity but I guess that's what patron is for lol. Amazing job, and the fact your voice is mellow really helps follow along or just listen to.

    • @samyam
      @samyam  3 года назад +1

      @@s.w.e.d.3057 Thanks! We also have a discord where you can ask help questions :)
      discord.gg/SwCKB3Q

  • @missing_the_texture
    @missing_the_texture 2 года назад

    i have import input system but there isn't any input action in my unity _
    help😭

  • @LukeHwarang
    @LukeHwarang 3 года назад +1

    Great tutorial, as always!

    • @samyam
      @samyam  3 года назад +1

      Thanks! :)

  • @matthewbergman6803
    @matthewbergman6803 Год назад

    Is there a way to put something like Shift+WASD or Alt+WASD on the input system? I want my player to switch targets while targeting. If they hold Shift, and then while holding shift press WASD, they will change their targets to the above/right/below/left.

  • @phosphorus8691
    @phosphorus8691 2 года назад

    Life saver. Thank you.

  • @adenpun
    @adenpun 2 года назад

    Great tutoriel! Thanks

  • @damiancds1
    @damiancds1 3 года назад +3

    I had started using the new system about a week or two before I found this video and I'm not sure if I'm doing something terribly wrong. Right now I have an action map with actions such as Jump or Dash, and I'm referencing them in my scripts with OnJump or OnDash as if they were functions. I haven't enabled anything, the only thing I've done is included it the input system via using UnityEngine.InputSystem and created a reference to the CharacterController (which the functions/actions influence). This way seems so much simpler than what you're showing and I don't know if it's going to cause a problem later on such as a memory leak or something (because I'm not enabling/disabling anything).

    • @samyam
      @samyam  3 года назад +2

      If the functions are called directly from the PlayerInput component (either through SendMessages, or the Events) then you should be fine. There's many ways to use the new system, you only need to unsubscribe from an event if you've subscribed to it somewhere in your script.

  • @keremaslan1988
    @keremaslan1988 2 года назад

    Would it be okay if I use Player Input component in several objects?

  • @benvella1728
    @benvella1728 2 года назад

    Have there been any major updates since the v1.0.2 demonstrated to the latest current v1.3.0?

  • @zii_2413
    @zii_2413 3 года назад

    Wonderful, thank you so much!

  • @benvella1728
    @benvella1728 2 года назад +1

    Any video on control schemes? Adding one is causing everything to break. I bind wasd and mouse to one scheme and Lstick and Rstick to another and for some reason I can only move with Lstick, not wasd and only look with mouse not rstick. Boggles my mind

    • @benvella1728
      @benvella1728 2 года назад +1

      I ended up deleted these for anyone's future reference and everything can work simultaneously. Not sure what's wrong with it but I've given up trying to figure out, and kept moving on with my tasks.

  • @riceandbeansowo4165
    @riceandbeansowo4165 2 года назад

    My jumpAction.ReadValue(); doesn't work in awake but it does for update?

  • @seraph1007
    @seraph1007 3 года назад +2

    Great video, unfortunately it was 1 day late since I got my project working yesterday with the new input system haha. This is unrelated to this video but on another video where you used a joystick, is there a way to make it into a floating joystick (entire joystick moves to the finger position then the joystick gets fixed there) I tried the default on mobile and it doesn't feel very smooth.

    • @samyam
      @samyam  3 года назад +1

      Thanks! Yeah you can change the On Screen Stick component to fit your needs, you can have a specified area that the user is allowed to touch for the joystick, then once the user touches that area you can enable to joystick there, and disable it when the use stops touching in that area
      answers.unity.com/questions/992906/placing-a-rect-and-detecting-a-touchtap.html

    • @yokj9081
      @yokj9081 3 года назад

      @@samyam excuse me I have some unity question. somebody can help me?I am Taiwanese so my English is not well.

  • @whidzee
    @whidzee 2 года назад

    how would you go about handling a bluetooth button to be an input for a game? I am wanting to make a mobile game and have a bluetooth button (the buttons you can get from aliexpress which bluetooth to the phone to allow you to take selfies without touching the phone). I have one of these buttons but I can't work out how to get unity to detect it as an input.

  • @LIt4g0
    @LIt4g0 2 месяца назад

    My hero.

  • @AetherXIV
    @AetherXIV 2 года назад

    29:54 does anyone know how she had her debug not make a new line if the debug msg is the same?

    • @AetherXIV
      @AetherXIV 2 года назад

      it was the "collapse" button above the console write outs

  • @zeroinfinity0
    @zeroinfinity0 3 года назад +1

    How to increase or decrease the value of 1d axis binding slowly and not directly to 1 or -1??..I also searched on web but people are saying there aren't any direct way to do it using new input system so i think you might give me the solution...

    • @samyam
      @samyam  3 года назад +1

      Unfortunately there is not a direct way in the input system to do so: you'll have to do it manually, you can use the SmoothDamp function
      docs.unity3d.com/ScriptReference/Mathf.SmoothDamp.html

  • @DDC-kx3uf
    @DDC-kx3uf Год назад

    This is a great tutorial, but does anyone know of any videos or websites that explain both event lambdas and subscribing to events in really basic terms? I've watched a couple input system videos and I've worked through most of the Unity Learn Input System project, but I still don't fully understand these two concepts.

  • @troyd9212
    @troyd9212 3 года назад +1

    Great video. I have a question though. When I press A and D at the same time, the composites add 1 to -1 making it 0. How could I tell which binding was pressed first so I can avoid the character stopping everytime I press keys of opposite directions?

    • @samyam
      @samyam  3 года назад +6

      The issue is that the Vector2Composite is coded like that, see
      github.com/Unity-Technologies/InputSystem/blob/bcc89c252897385f1adb8e3fc320e7a7c442862b/Packages/com.unity.inputsystem/InputSystem/Actions/Composites/Vector2Composite.cs
      This is where it'll result in zero
      var result = new Vector2(leftValue + rightValue, upValue + downValue);
      github.com/Unity-Technologies/InputSystem/blob/bcc89c252897385f1adb8e3fc320e7a7c442862b/Packages/com.unity.inputsystem/InputSystem/Controls/DpadControl.cs#L124
      You can make your own custom composite and basically copy the existing one but with your changes. I show how to make a custom one here
      ruclips.net/video/KXF3OR78iVY/видео.html

  • @random_precision_software
    @random_precision_software 2 года назад

    Unity will let you use both systems in a final build?

  • @akanopoi6177
    @akanopoi6177 2 года назад

    why every time i modify the default input action, every change goes back to default the next time i open unity?

  • @Alimoselhy1304
    @Alimoselhy1304 2 года назад

    I also really like softEX, it has a very nice effect to it

  • @blinkachu5275
    @blinkachu5275 2 года назад

    playerInput does not contain a definition for "actions"
    Any idea what the cause of that could be?

  • @StormyDoesVR
    @StormyDoesVR 2 года назад

    the PlayerControls setting isn't working for me, says it can't find that.

  • @lornemalvo5664
    @lornemalvo5664 2 года назад

    How can i listen Android Hardware Back Button with new input system. I tried Usages>Back on InputAction but not worked

  • @elitefusionz02
    @elitefusionz02 2 года назад

    I get this error in my console. I'm trying to open/close various things.
    NullReferenceException while executing 'performed' callbacks of 'Player/E[/Keyboard/e]'
    UnityEngine.InputSystem.LowLevel.NativeInputRuntime/c__DisplayClass7_0:b__0 (UnityEngineInternal.Input.NativeInputUpdateType,UnityEngineInternal.Input.NativeInputEventBuffer*)
    UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate (UnityEngineInternal.Input.NativeInputUpdateType,intptr)

  • @th3R341W3n
    @th3R341W3n 3 года назад

    On 21:53 I got an error says: 'PlayerInput' does not contain a definition for 'actions' ...

    • @samyam
      @samyam  3 года назад

      PlayerInput is the type, you need a reference to your actual playerInput component
      PlayerInput playerInput = GetComponent();
      playerInput.actions...

    • @th3R341W3n
      @th3R341W3n 3 года назад

      @@samyam Thanks for your replay! I did what the tut says:
      ```C#
      private PlayerInput myInput;
      private void Awake()
      {
      myInput = GetComponent();
      //myInput.actions... //won't compile
      myInput.FindAction... //compile
      }
      ```
      p.s. My Input System version is 1.2.0

  • @hapash
    @hapash 2 года назад

    your video is amazing thanks lady