Unity3D- Add Controller Support in 5 Minutes With No Coding!

Поделиться
HTML-код
  • Опубликовано: 31 дек 2024
  • UPDATE- This video is outdated now! You can still use this method for the time being with the old UnityEngine.Input API, but that is being replaced with the Input System Package for newer versions of Unity. Maybe there will be a new video when I figure it out myself! Now, the old video description:
    So, your player controller script has all those calls to Input.GetButton() and Input.GetAxis(), right? Let's set up your game to recognize controllers without touching your script!
    Here's the controller map I used as reference. Remember that Axes 4 and 5 are swapped!
    answers.unity....
    And follow me for all kinds of game stuff-
    Twitch: / sonofgragas
    Twitter: / sonofgragas

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

  • @SkanDogVids
    @SkanDogVids 4 года назад +9

    This is extremely convenient i just finished my basic movement like you. I thought it was funny that the default jump for me was the Y button Y axis when i realized why it was like that I chuckled

  • @lounesb9802
    @lounesb9802 2 года назад +5

    BROOO THANK YOU SO MUCH ! I have an exam tomorrow (im in an art school) and I couldnt find a way to fix the camera so I was panicking and I then I found your video: you saved my life !!! straight to the point and all, I hope you are rich bro u deserve to succeed in life ! tomorrow I will update you about my exam and if i pass this exam you played a part in it bro so thank you again for helping the community u are a hero

  • @jordan2d
    @jordan2d 4 года назад +23

    "With no coding!"
    Within first minute, opens C#

    • @sonofgragas8511
      @sonofgragas8511  4 года назад +11

      No coding, assuming you already have the typical code in place for keyboard/mouse input 😁

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

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

  • @grimbithefloob3251
    @grimbithefloob3251 3 месяца назад

    literally thank you so much every single unity/stack overflow article were making the solutions way more complicated than need be!!

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

    You are my hero!!!! I just got a pc controller to use in Unity, and I couldn't figure out how to spin the camera. Thank you good sir! Thank you!!!

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

    I've literally been searching for this for 2 weeks mow. Thanks

  • @KidouKenshi22
    @KidouKenshi22 3 месяца назад +1

    good video, but how can I add attacks on combination of buttons? Like I use a ps4 controller and I want my skills to be on R2+Square, triangle etc.

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

    Triggers, sticks and d-pad doesnt work for some reason. ..

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

      These are all treated as axes rather than buttons, so instead of Input.GetButton returning true or false, Input.GetAxis and Input.GetAxisRaw will return a number between -1 and 1. If you want to treat them as buttons you can do something like-
      if (Input.GetAxisRaw("[Right Trigger Input Name]") > 0)

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

    How to get joysick position? Like Input.mousePosition but for joysick

  • @ronnyrrr932
    @ronnyrrr932 4 года назад +5

    Will this also work in note pad I’m trying to change the controls for a mod

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

    thank you! this helped a lot!

  • @Sir-Evil_Laughington
    @Sir-Evil_Laughington Год назад

    i almost completely switched the new input system and almost ruined my game thanks man😅

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

    keep up the great work!

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

    when my player flips the controls flip too im using a ball so it rotates the entire time

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

    Good Tut, beautiful and apt.. great job you got here. 📌

  • @dynogamergurl
    @dynogamergurl 9 месяцев назад

    will this work with netcode and online multiplayer?

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

    thanks you are my new god

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

    Which visual Studio are you using brother?

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

    Hi Son Of Gragas you can choose to use both the input thingies so u can have the new and old will this still work??

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

      Dont matter it works thx for THE amazing tutorial

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

    Yoooo thank you my guy

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

    KeyCode

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

    dope Thank you!

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

    Thank you :)

  • @shadowshark4201
    @shadowshark4201 5 лет назад +1

    this is cool

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

    thanks man thanks alot

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

    thank you so much

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

    excellent tutorial bro!!! :D
    thank you very much!!! \(^.^)/

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

    follow u in the street lol

  • @_SharkHunter_
    @_SharkHunter_ 5 лет назад

    cool

  • @shadowshark4201
    @shadowshark4201 5 лет назад +1

    I subscrlbed

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

    "No coding"

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

    Thanks so much!