CONTROLLER INPUT in Unity!

Sdílet
Vložit
  • čas přidán 28. 08. 2024

Komentáře • 749

  • @Brackeys
    @Brackeys  Před 4 lety +158

    Hey everyone!
    To those of you who can't find the package: Unity has moved the "Show Preview Packages".
    You can now find it under Edit -> Project Settings -> Package Manager -> Enable Preview Packages.
    If you check that box, you should see preview packages in the Package Manager! :-)
    Stay awesome!

    • @thanitsakleuangsupornpong2449
      @thanitsakleuangsupornpong2449 Před 4 lety +1

      Anyone please. Should I use Incrontrol from Asset Store or Unity new Input System? Thanks in advance. What is better?

    • @filgas0892
      @filgas0892 Před 4 lety

      I does not find it, can change by unity version?

    • @Triarawn
      @Triarawn Před 4 lety

      @@filgas0892 You can now find it in Package Manager, under the 'Advanced' tab. Hope this helps!

    • @filgas0892
      @filgas0892 Před 4 lety

      Triarawn I find it

    • @pedror1439
      @pedror1439 Před 4 lety +1

      uhh for me it’s causing errors from my player movement, is it because of the input?
      i tried deleting the input but I think it destroyed my game

  • @anthonyroseiro
    @anthonyroseiro Před 4 lety +270

    If you can't select stick :
    click on Action -> action type -> value, then under it you can select stick. Now you can bind your stick and don't forget to save asset !

    • @lukascook8477
      @lukascook8477 Před 3 lety +11

      What a pro. This is why I love the internet. Thanks.

    • @loater
      @loater Před 3 lety +6

      thx dude

    • @ilovemuffins1337
      @ilovemuffins1337 Před 3 lety +16

      For those wondering, "Action" is located when you press the green icon bar that we named "Move" (dont click the plus). There, it will show "Action" in the same place that binding normally shows

    • @minibuffness
      @minibuffness Před 3 lety +2

      Thanks, very helpful!

    • @tageueland
      @tageueland Před 3 lety +2

      Thank you

  • @Mattggiano
    @Mattggiano Před 5 lety +378

    Only we programmers could be happy to see a cube spinning in an empty space.
    Thank you so much for the tutorial!

  • @lAcedUpLiss
    @lAcedUpLiss Před 3 lety +24

    My year 1 uni assignment is due and I wanted to use controller input. Thank you so much, this tutorial is a lifesaver! I'm so sad that you retired from YT, hands down my favourite teacher on here.

  • @PixelDough
    @PixelDough Před 5 lety +84

    Once I heard you say "allow us to avoid using strings" I immediately fell in love with this new input system. 10/10 tutorial.

    • @47Mortuus
      @47Mortuus Před 4 lety +3

      if (Input.GetKeyDown(KeyCode.Return))
      Sorry, i fail to see any strings...................

    • @PixelDough
      @PixelDough Před 4 lety +2

      47Mortuus sure, yeah, if you’re using straight up keyboard inputs. We’re talking about controller support, which requires using the Input system’s “actions” with axis settings.

    • @47Mortuus
      @47Mortuus Před 4 lety

      @@PixelDough I guess so - that what the new system is best at: controller and especially cross-platform support.
      But even then - I don't see how 10 bytes of garbage per frame (unless you don't have an input manager and actually call Input.GetAxisRaw() form more than one script) has any significance.

    • @tobihudiat
      @tobihudiat Před 4 lety +5

      @@47Mortuus He meant Input.GetAxis("Horizontal") for example

  • @JoelAbad
    @JoelAbad Před 4 lety +174

    Unity 2019.3.12f1 on MacOS and Xbox One Controller. I wasn't able to select the "Left Stick" option on the Binding Path, only its child (Up, Down, Left, Right). What I did was select any of the child and pressing the small "T" button I changed the text to "/leftStick" and now it works fine.

    • @Glaas_
      @Glaas_ Před 4 lety +5

      Thanks buddy, I was looking for this !

    • @elirockenbeck6922
      @elirockenbeck6922 Před 4 lety

      Sweet! Thank you!

    • @robert.lafferty
      @robert.lafferty Před 4 lety +33

      I was looking at another video on how to do multiplayer with this system and they showed exactly how to do it without this workaround. Click on "Move" (for example), change Action Type to "Value", and then change the Control Type to "Stick". Then when you click listen, it'll show up as "Left Stick". Hope this helps!
      czcams.com/video/D8nUI88POU8/video.html

    • @jacinthdanielmoses3647
      @jacinthdanielmoses3647 Před 4 lety +6

      What I did was was in the parent of the binding I turned the action type to “value” and the control type to “any”

    • @gabrielserra
      @gabrielserra Před 4 lety +1

      LIFESAVER. thank you!

  • @GameBientStudio
    @GameBientStudio Před 4 lety +20

    Using movement that way has a really odd behaviour in which the movement of the stick isn't updated every time.
    Instead, I wrote
    move = controls.Gameplay.Move.ReadValue();
    inside Update() and everything is working absolutely fine now. Hopefully this will help others watching this video.
    Thanks anyways to the Brackeys team educating me about how the new Input System works!

  • @kuteninja
    @kuteninja Před 5 lety +109

    Beware when using lambda expressions on non volatile objects, since it's not possible to substract them, unless you save a reference to the lambda you'll create a new one if you write it again which won't be present on the action list.

  • @MasterofGalaxies4628
    @MasterofGalaxies4628 Před 2 lety +15

    I'm sure there are at least a few users watching this wondering how to go about setting up multiple unique controllers for co-op/local multiplayer, and keeping any given input asset instance from receiving input data from EVERY SINGLE active device. Having struggled to figure this out myself months ago, especially since I also wanted to make it work with the auto-generated C# class feature as well to take advantage of all the safety features C# provides when working with it, I thought I'd share the solution I came up with, which uses a lesser-talked about feature of the New Input System called Input Users (note that in my example, "InputReference" is the name of the input action asset and by extension the C# class):
    using UnityEngine.InputSystem;
    using UnityEngine.InputSystem.Users;
    public class Player
    {
    public readonly InputReference Input;
    private InputUser User { get; }
    public Player(params InputDevice[] devices)
    {
    Input = new InputReference();
    User = InputUser.CreateUserWithoutPairedDevices()
    User.AssociateActionsWithUser(Input);
    for (int i = 0; i < devices.Length; i++)
    InputUser.PerformPairingWithDevice(devices[i], User, i == 0 ? InputUserPairingOptions.UnpairCurrentDevicesFromUser : InputUserPairingOptions.None);
    }
    public void Decommission()
    {
    User.UnpairDevicesAndRemoveUser();
    }
    }
    With this class, I could create a unique Player object for each active player. Notice in the constructor that in addition to the input action asset instance, an InputUser is also created, with which the input asset instance is then paired. Once that's done, each input device passed in to the constructor (the params allows for any number, letting me pass in, say, either a single controller, or a keyboard and mouse as a pair), is also paired to the InputUser. Now, the input asset instance will only receive events _from those specific devices_, which lets me register for a specific player's move/jump/whatever as opposed to _every_ player's move/jump/whatever and then needing to figure out which device it originated from.
    Note there's also a decommissioning method, to clear the user and pairings out if you need to deactivate a player. This will ensure device pairings, input user entries, and other behind-the-scenes things get cleaned up when you no longer need them.

    • @spotlessapple
      @spotlessapple Před rokem

      Thank you! This solved my issue. Had to make a few small modifications to the original script being used in the video to reference this class, but works like a charm. In my case, I was using xbox controls (hence, XInputController class, see docs on the input system for other supported classes like DualShock). In my case, I named the same class you have above as "UniqueLocalMultiplayer":
      using UnityEngine.InputSystem;
      using UnityEngine.InputSystem.XInput;
      ...
      ...
      XInputController xboxInputController = (XInputController)GetComponent().devices[0];
      var ulm = new UniqueLocalMultiplayer(xboxInputController);
      // Declared "input = new InputReference()" in class I copied from you, used lowercase for mine
      controls = ulm.input;
      controls.Player.Movement.performed...
      controls.Player.Movement.canceled...
      controls.Player.Jump.performed...
      ...

    • @Pardaleco2
      @Pardaleco2 Před rokem +1

      Hello, is there any way I could talk with you somehow about this solution?

    • @aktchungrabanio6467
      @aktchungrabanio6467 Před rokem

      @@Pardaleco2 I'm sorry babe but that can't happen

  • @cubeflinger
    @cubeflinger Před 3 lety +3

    I dont know how I'm going to do this without you.

  • @Manuel-cm1jg
    @Manuel-cm1jg Před 5 lety +246

    can you make a multiplayer tutorial for unity 2019?

    • @brandonlee0115
      @brandonlee0115 Před 5 lety +6

      yesyesyesyesyes

    • @dan-mechanics2014
      @dan-mechanics2014 Před 5 lety +3

      Please

    • @dedovagency
      @dedovagency Před 5 lety +1

      @@Goferek5 will it?

    • @gbnp5579
      @gbnp5579 Před 5 lety +2

      @@dedovagency i think its too coplicated to make a tutorial like that

    • @dedovagency
      @dedovagency Před 5 lety +1

      @@gbnp5579 he's shown how to make FPS multiplayer game, it's not that hard for him to make updated multiplayer tutorial.

  • @welltypedwitch
    @welltypedwitch Před 5 lety +175

    Now what about multiple controllers (a.k.a. couch-coop)?!?

    • @TheAzuratis
      @TheAzuratis Před 5 lety +13

      That's the same question I have.

    • @ZoidbergForPresident
      @ZoidbergForPresident Před 5 lety +16

      Several ways of doing it:
      1 Different actions per player: movePL1, movePL2
      or 2 Different actions maps per player: gameplayPL1, gameplayPL2

    • @TheAzuratis
      @TheAzuratis Před 5 lety +13

      And how do you differ bedween to two connected Gamepads?

    • @welltypedwitch
      @welltypedwitch Před 5 lety +9

      @@ZoidbergForPresident Have you tried that? Itt doesn't seem like you can differentiate between Gamepads.

    • @synsam12345
      @synsam12345 Před 5 lety +9

      I would recommend the plug-in Rewired. It also handles different input from different gamepads.

  • @MikaelL
    @MikaelL Před 2 lety +1

    Thanks Brackeys for this tutorial🙂

  • @jonteboimakesgames
    @jonteboimakesgames Před 5 lety +29

    Thank you soooo much for the tutorial!!!!! I’ve been looking for this for soooo long! Awesome tutorial Brackeys!

  • @MissAllesmere404
    @MissAllesmere404 Před 5 lety +4

    Oh my goodness this is SO much easier than Unity's old system! Can you use this same system to set multiple controller types, that the player can switch between? Such as switching between Keyboard/mouse and Controller, and using a config to set prefered actions to different keys? This could make accessibility access SO much easier to manage!

  • @ram97tabla
    @ram97tabla Před 5 lety +3

    Hell ya thank you Brackeys, your smile and positive energy plus great content really keeps me motivated and learning as I learn the ins and outs of Game Development. Thank you so much!

  • @zdvy
    @zdvy Před 5 lety +2

    Can you make videos were you play games created or suggested by fans and this allows you to give them tips on what they can improve on and what you like about their game. That would be amazing to watch!

  • @BartintVeld
    @BartintVeld Před 5 lety

    I always created an InputManager that would fire events when a button was pressed. This completely removes the need to make an InputManager, COOL!

  • @arcadebox
    @arcadebox Před 4 lety

    dude u dont know how much i love your job always very simple to understand even if im not english and the best tuto on youtube THANKS

  • @superzova
    @superzova Před 5 lety +4

    THIS is the video I've been waiting for. Thank you!

  • @theloafdude8304
    @theloafdude8304 Před 5 lety +4

    seriously. I've waited so long now, finally

  • @robertcohn8858
    @robertcohn8858 Před 4 lety +1

    This is an exceptionally well-done tutorial. The content level, step-by-step instructions and subject matter are very clear. Thank you!

  • @afluffycat9522
    @afluffycat9522 Před 5 lety

    I spent like a month trying to get it to work and now you're here telling me that the new input system makes it easy! DAMN IT
    Edit: I actually tried to recreate you're ballgame

  • @AllyG1967
    @AllyG1967 Před 4 lety +1

    Thank, just what we were looking for. This is a great starting point. Next steps for us is to find out how to trigger animations using this method. Walk, Run, Jump, Punch, Kick.

  • @ddotbuk
    @ddotbuk Před 5 lety +8

    I think the explanation of Lambda functions is possibly confusing, it doesn't really explain anonymous parameters and doesn't explain how it can be used in a real sense, other than to ignore the parameters being passed in and 'make it work' for this case.
    What's wrong with passing the parameter in anyway and just ignoring it? It's easier to read than some complex syntax that could be hard to understand in certain situations.

  • @Xeculus
    @Xeculus Před 5 lety +4

    EXACTLY WHAT I WAS LOOKING FOR! No need to look elsewhere now lol

  • @huntserston3579
    @huntserston3579 Před 5 lety +2

    Nice! Now I can effectively switch between types of controllers or ways to play!

  • @a1be31s8x9
    @a1be31s8x9 Před 3 lety

    TY Brackeys you were a god among youtubers

  • @MSibrava
    @MSibrava Před 3 lety

    OMG Thank you! Finally a simple explanation to what I walked into when I imported the new Input System!

  • @swiftgames5382
    @swiftgames5382 Před 5 lety +2

    Excellent! this is what I've been waiting for. Many thanks Brackeys.

  • @mykytamarkianov4870
    @mykytamarkianov4870 Před 5 lety +15

    Thank you for this video!
    Sad... Jason's courses are to expensive for me(((

  • @insertusernamehere8125
    @insertusernamehere8125 Před 4 lety +1

    Thanks! This helped because im making a fun local multiplayer fighting game real quick that I can play with my brother and friends

  • @reprdev
    @reprdev Před 2 lety

    The cool cats of front-end web development refer to "Lamba Expressions" as "Arrow Functions"😎
    Great tutorial!

  • @abhisheksuper20
    @abhisheksuper20 Před 5 lety +1

    Been waiting for way too long to get this video. Thanks Brackeys !!

  • @iggythemad8701
    @iggythemad8701 Před 5 lety +9

    Hey there Brackeys! First of all: Thank you so much. Your tutorials are helping me a lot in my game dev journey. Second: I've got 2 questions. Why is this better than the old input system? Aaaand... Could you make a tutorial on navigating a UI with a controller? Like an inventory or something. Love youuu

  • @Gooseguy1000-1
    @Gooseguy1000-1 Před rokem

    I’m definitely comfortable with the getkey method of doing inputs but this seems like a great system to switch to for lots of reasons. Thanks Brackeys :)

  • @dishdash3314
    @dishdash3314 Před 5 lety +28

    Your almost at 1 mil subs, YOU CAN DO IT :D

  • @BilalKas
    @BilalKas Před 2 lety

    great tutorial, searched for a lot of but this one was by far the best for me

  • @fightinggamescombos6820

    Never paid too much attention but not looking into it deeper it is much better indeed.

  • @SwitchStop
    @SwitchStop Před 5 lety +3

    Glad to see you’re using the *best* controller in the thumbnail 😁

    • @nostalgia5031
      @nostalgia5031 Před 5 lety

      I don’t care about consoles, I only care about how fast it runs

    • @somnia3423
      @somnia3423 Před 5 lety

      @@nostalgia5031 sowhat? controllers are a pc thing too

    • @DreadKyller
      @DreadKyller Před 5 lety

      @@nostalgia5031 many people use controllers on PC as well because the fine control of an analog stick over the either off or on control of buttons like WASD.

    • @nostalgia5031
      @nostalgia5031 Před 5 lety

      @@DreadKyller He changed the logo... Lol

  • @ASandwall
    @ASandwall Před 5 lety +59

    I saw the gamecube controller on the thumbnail, and I clicked. Does this mean I'm a simple person?

  • @WadeStar
    @WadeStar Před 4 lety +7

    11:20 Very important. Remember to enable the damn thing.

    • @VagrantOfTheWorld
      @VagrantOfTheWorld Před 3 lety +1

      Omg thank you so much you saved my day!!

    • @WadeStar
      @WadeStar Před 3 lety

      @@VagrantOfTheWorld lol, no problem!

    • @jorge5161
      @jorge5161 Před 3 lety +1

      Someone give this person a medal

  • @noahhildebrandt1298
    @noahhildebrandt1298 Před 5 lety +3

    Thank you for the video - I was wondering how this new system was turning out. From first glance, this looks unnecessarily clunky and complicated. I'm happy I invested in Rewired awhile ago - much easier/cleaner syntax and setup, and it handles every controller I've ever tried.

  • @CoolJosh3k
    @CoolJosh3k Před 5 lety +5

    Designing a remapping/rebinding option menu using this system?

  • @ryanshirvani
    @ryanshirvani Před 5 lety +1

    good video Brackeys the input for controllers works on lots of platforms thanks.

  • @Devsplorer
    @Devsplorer Před 3 lety

    This was very helpful to understand the new Input System 🙌 I really liked using context

  • @GenuineXray
    @GenuineXray Před 5 lety +197

    Let's show off a black controller on a black background, wearing a black shirt!

  • @SplooflagerFun
    @SplooflagerFun Před 5 lety

    Man ...
    I wish you got 10 Millions Subs ! You rock

  • @intimidate2161
    @intimidate2161 Před 5 měsíci

    Great tutorial. Easy to understand.

  • @michelangelobaroni938
    @michelangelobaroni938 Před 4 lety

    thank you!!! I really appreciate these tutorials! Something things get tricky, yet find errors is much satisfying :) DON'T GIVE UP!!!

  • @lemetamax
    @lemetamax Před 5 lety +16

    I've got one question Brackeys: Do you have telepathic powers? First ragdoll physics, now game controller. The exact series I need to create a realistic humanoid movement script. Thanks!!!!!!!!

  • @AhmedA44
    @AhmedA44 Před 5 lety +2

    Thanks, I was really struggling with this today. Right on time

  • @ImInfenix
    @ImInfenix Před 5 lety

    THANK YOU was looking for it for now a month and wasn't able to find anything interesting allowing me to do what i wanted to

  • @Infinity-dp8cd
    @Infinity-dp8cd Před 5 lety

    Ahah,I tried to find how to make a controller input yesterday at your channel and there is a video today,you are the best!

  • @MrJohnweez
    @MrJohnweez Před 5 lety +3

    I don't think everyone appreciates just how easy it is now to set up a controller or almost any kind!

  • @joaovictorfernandescabral377

    Hey, nice video, but what about multiplayer games?

  • @waynehawkins654
    @waynehawkins654 Před 3 lety +1

    Thank you so much, this was a well demo video. But we are now out of beta. I love to see a updated using the new Player Input and with the Behavior using 'Invoke C Sharp Events'

  • @Rumplestiltzchen
    @Rumplestiltzchen Před 4 lety +9

    for some reason when I do this it gives me an error - Object reference not set to an instance of an object
    PlayerControls.Initialize () (at Assets/PlayerControls.cs:22)

    • @FatRogSlim
      @FatRogSlim Před 3 lety +2

      PlayerControls is the name he gives to his object at the step where he create a new input action. Check the c# file you created at the step "generate c# script". select the name of the class (it looks like how you named the input action) and replace "PlayerControls" by it in your code, and voila

    • @ManasJoshi
      @ManasJoshi Před 3 lety +1

      I am getting the same error. I just don't know why this is happening.

  • @myburghroux
    @myburghroux Před 4 lety +4

    Hello. I keep getting this error
    Assets\Cube.cs(16,18): error CS1061: 'PlayerControls' does not contain a definition for 'Gameplay' and no accessible extension method 'Gameplay' accepting a first argument of type 'PlayerControls' could be found (are you missing a using directive or an assembly reference?)

    • @myburghroux
      @myburghroux Před 4 lety +3

      nvm, fixed. had to check auto save in the player controls window

    • @xinera7489
      @xinera7489 Před 4 lety +2

      thanks man, that solved my issue

  • @CarlitoProductions
    @CarlitoProductions Před 4 lety +1

    I'm looking forward to seeing this come out of preview, it reduces spaghetti code so much; need to get used to the syntax, but it makes things so much cleaner

  • @twinkalraj5084
    @twinkalraj5084 Před 4 lety +1

    How can i replace objects and object prefabs using collision in unity

  • @notRafa1
    @notRafa1 Před 2 lety +1

    how can we increase the speed in wich the player moves?

  • @krazykase3419
    @krazykase3419 Před rokem

    even if this comment is late. thank you brackeys this video helped me learn more about the input system and how to use it

  • @cesarperalta4959
    @cesarperalta4959 Před 3 lety

    That keyboard sounds so good!

  • @HolidayAtHome
    @HolidayAtHome Před 2 lety +1

    super useful ! Thanks =D

  • @tysonmellor7998
    @tysonmellor7998 Před 4 lety +2

    Unity gives me the error code saying "The type of namespace name 'InputSystem' does not exist in the namespace 'UnityEngine' " After doing the initial Grow function script. Any ideas on why that is the case??

  • @Mikelica69
    @Mikelica69 Před 2 lety +1

    Thanks Brackeys! 😭😭

  • @faustNebel
    @faustNebel Před 5 lety

    Exactly what I was struggling with like 2 weeks ago ! Thanks a lot!

  • @mikaxms
    @mikaxms Před 5 lety +2

    I don’t understand why you can check if a button is pressed in the awake function, since the awake function is only called once (at the start).

    • @1e1001
      @1e1001 Před 5 lety +1

      It doesn't check that the button is pressed, it just tells the input system that "when x is pressed on the controller, run this function"

    • @stafs
      @stafs Před 5 lety +1

      It doesn't, it just sets a callback when the button is pressed. What that means is you telling it at the start to call a bit of code every time a specific event happens, and in this case it's the Grow() function that is called each time the down button is pressed.

    • @TheCebbi
      @TheCebbi Před 5 lety

      You're not checking if the button is pressed. We're adding an action to the "performed" event. The input system constantly listens to the controller inputs and if a button that triggers "Grow" is pressed, all previously added actions are called.
      It's like having an empty function in the beginning and you can add statements to its body at runtime.

  • @thecrin5843
    @thecrin5843 Před 2 lety

    ohhhhh thanks, when I saw all the options that Unity gave to connect a control, with your video I finally managed to understand how to use the Input System library.
    Unfortunately in my language there was not a good tutorial on how to do this, many games already made with the scripts already made and since I did not have that project they were working with, It was impossible for me to know how the package worked when they used ready-made programs, instead of showing how each command worked. Anyway thanks

  • @wolfqgamming1219
    @wolfqgamming1219 Před 5 lety +5

    Can you make a video using this for 2 or more controllers too pleaseeeee :'(

  • @thanitsakleuangsupornpong2449

    Anyone please. Should I use Incrontrol from Asset Store or Unity new Input System? Thanks in advance. What is better?

  • @NestedMango
    @NestedMango Před 5 lety +1

    Thanks for Sharing 😘

  • @Shodan-0101
    @Shodan-0101 Před 2 lety

    Man I miss them so much!!

  • @tl9826
    @tl9826 Před 3 lety +2

    If you want to move the player on x and z axis, do the following:
    Change variable "Vector2 move;" to -> "Vector3 move;"
    The "void Awake()" section will not change, what you need to change is the "void Update()" part:
    From:
    Vector2 m = new Vector2(-move.x, move.y) * Time.deltaTime;
    To:
    Vector3 m = new Vector3(-move.x, 0, -move.y) * Time.deltaTime;
    Note that Vector3 takes 3 values(x, y, z). Use 0 in y and use "-move.y" as the z
    Same as for x move, the minus is to have that "non-inverted" behavior/feeling

    • @dane4944
      @dane4944 Před 3 lety

      Whoever you are, you just saved my skin and stopped me from going insane over this Thank You!!

    • @Radiofloyd
      @Radiofloyd Před 3 lety

      Thank you.

  • @kpredkiewicz
    @kpredkiewicz Před 5 lety +1

    Like, i recently went trough hell making input system for xbo controller, and now you are uploading a tutorial... witch is great, but now i see my life is kinda ironic

  • @michaelderosier3505
    @michaelderosier3505 Před 2 lety

    Quick-Accurate-SimpleTerms! TY

  • @beleventh3998
    @beleventh3998 Před 5 lety +5

    Nice video 😊. I'm wondering though how this will map to the UI event system 🤔

  • @aldo4833
    @aldo4833 Před 5 lety +9

    What if there is a local multiplayer with multiple controllers?

    • @mrungleich
      @mrungleich Před 4 lety

      it is really simple to integrate using the PlayerInputManager docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/Components.html#playerinputmanager-component

  • @ZippyDoodah
    @ZippyDoodah Před 4 lety +2

    How do i move in the Z direction also then? I cant use a vector3 as i get an error saying it cant read the value type of "Vector3"

    • @MrLokhe
      @MrLokhe Před 4 lety +4

      I know you probably already solved it, but in case you didn't or anyone else is wondering like I did, here's how:
      On the row -> Vector2 m = new Vector2(move.x, move.y) * Time.deltaTime; you can simply change it to a Vector3.
      -> Vector3 m = new Vector3(move.x, 0f, move.y) * Time.deltaTime;

  • @SonicDash-zi8bf
    @SonicDash-zi8bf Před 5 lety +3

    Can you make a tutorial for water physics? (Mario swimming style)
    I think you should try to make a water tag for the tutorial as well!

    • @aquaarmour4924
      @aquaarmour4924 Před 5 lety

      Just slow down the gravity and movement underwater, add force with the press of a button. Too simple for a video. Do the research yourself

    • @SonicDash-zi8bf
      @SonicDash-zi8bf Před 5 lety

      @@aquaarmour4924 Well I'm a bit of a beginner so I need to learn how to make that code.

  • @j-t-ogamingblahblah3025

    once again, brilliant - gonna be so much easier save so much time. thx again mate.

  • @ilovemuffins1337
    @ilovemuffins1337 Před 3 lety +1

    Hello, welcome from the future! This example only works in the 1.0.0+ version if you call .Enable() on your PlayerControls variable before assigning action callbacks

    • @GGOOSEO
      @GGOOSEO Před 2 lety

      i spent like 1 day trying to fucking fix this holy shit you saved my game lol

  • @juniorgoncalves4535
    @juniorgoncalves4535 Před 3 lety

    Dude, awesome content! Really well explained! Thank's a bunch!

  • @otsugua_b2155
    @otsugua_b2155 Před 5 lety +1

    You are the best !
    I have an idea, why not make a tutorial for a fighting game like Tekken or Super Smash Bros ?

  • @darkwyvern9796
    @darkwyvern9796 Před 5 lety +1

    Great tutorial!
    Do you think you could make a video in the future about multiple gamepads using the new input system?

  • @welltypedwitch
    @welltypedwitch Před 5 lety +4

    10:45 if you don't use the parameter, just call it _ that just makes it easier to read. :)

    • @welltypedwitch
      @welltypedwitch Před 5 lety

      @Nuke Dukem are you okay ? :)

    • @welltypedwitch
      @welltypedwitch Před 5 lety

      @Nuke Dukem This is pretty standard stuff. VS Code even gives you a warning if you don't use a parameter and don't call it _

  • @mlggeek1812
    @mlggeek1812 Před 5 lety +1

    Great video as always! I would love it if You could make a video on building a game for console and how to play it on a console.

    • @54games25
      @54games25 Před 5 lety

      The only way to do so is to be a certified dev with that console's company.

  • @alexfranco2048
    @alexfranco2048 Před 3 lety +1

    If you have the issue where wasd works but a joystick doesn't (InvalidOperationException: Cannot read value of type 'float' from control...blah blah error)
    Use a simple binding for map the joystick. Set the Action to "Pass Through" and " Vector 2". That worked for me

  • @allecksy8261
    @allecksy8261 Před 5 lety +6

    Can you please make a video to explain the new multiplayer system of unity 2019

  • @russellhinkley7449
    @russellhinkley7449 Před 5 lety +1

    perfect timing!

  • @adhochero6619
    @adhochero6619 Před 5 lety +5

    neat. so how would you use WASD keyboard movement with the new input system? would you have to make one for each button, or do they have something like horizontal and vertical axis?

    • @WesleyOverdijk
      @WesleyOverdijk Před 4 lety +1

      Did you find an answer to this? I have the same question right now.

    • @Katze3103
      @Katze3103 Před 4 lety

      for keyboard there are input settings in unity implemented. please look for them in the setting to get them right. - docs.unity3d.com/ScriptReference/Input.GetKeyDown.html - jumping, fire weapon, walking around with arrow and WASD is already implemented in unity

    • @BaconDeez
      @BaconDeez Před 4 lety +1

      @@Katze3103The Link you provided just references the old way to do it.

    • @Katze3103
      @Katze3103 Před 4 lety

      @@BaconDeez that changed so quickly. and there are always numberous ways to get to goal.

  • @SarpSpeaksSometimes
    @SarpSpeaksSometimes Před 4 lety +1

    'PlayerControls' does not contain a definition for 'Gameplay' and no accessible extension method 'Gameplay' accepting a first argument of type 'PlayerControls' could be found (are you missing a using directive or an assembly reference?)
    Anyone has an idea why this happens?

    • @connora6218
      @connora6218 Před 4 lety +2

      you need to save your input map thingy. at the top it has a save button. click it

    • @SarpSpeaksSometimes
      @SarpSpeaksSometimes Před 4 lety

      @@connora6218 oh yeah I had already found that out like 1 hour after posting this comment but I forgot to come back here and delete the comment afterwards, but thanks anyway!

  • @philunityunreal7228
    @philunityunreal7228 Před 4 lety

    This is best tutorial i have ever seen for teaching Gamepad in Unity. However, I have s small question: I am currently developing a PC game and I just did the input from the keyboard. Is there a way to adapt this into GamePad? This tutorial seems to be good for making a game from scrash but not to pit in GamePad what it is already done in keyboard. Thanks for your attention. Greetings.

  • @adityapandya8098
    @adityapandya8098 Před 3 lety

    Thank You Sir!

  • @RemiStorms
    @RemiStorms Před 4 lety +7

    Im trying to do this with version of Unity 2019.3.0f1 and InputSystemPackage ver 1.0.0 preview and it doesnt work. Is anyone having the same issue?

    • @gabrielserra
      @gabrielserra Před 4 lety +2

      yeah, doesn't seem to work like that anymore... also can't do it. i could do the transform, but both movements did not happen.

    • @EchoPrograms
      @EchoPrograms Před 3 lety

      @@gabrielserra did you reload unity?

    • @gabrielserra
      @gabrielserra Před 3 lety

      @@EchoPrograms I can't remember what was the solution, but i found it on the comment section of this video eventually

  • @dbzlinkinpark99
    @dbzlinkinpark99 Před 4 lety +1

    at 15:20 the only reason he has to invert the X axis, is like he said, he has his camra flipped and facing the back of the cube, if it weefacing the front of the cube he wouldn't have to invert th X axis. Small things he probably just forgot while setting up his camera, or did on purpose for the purpose of learning and letting you know if you flipped you camera, invert the axis you flipped your camera by

  • @shrekinaskeri01
    @shrekinaskeri01 Před rokem

    thanks man!!

  • @paulogodinho3275
    @paulogodinho3275 Před 5 lety

    I believe you made a conscious decision to use the Lambda Functions there as they add unnecessary complexity, you could just made functions with the Context Parameter. Nice to see the ramp up in complexity on your videos, with shader work and now Lambdas, thank you so much for your videos!

  • @aadityakiran_s
    @aadityakiran_s Před 3 lety +1

    Great video. Too bad that you had to stop. You should in some way get back to it. Thanks.