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
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
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
Best of luck on your exam! You got this!
did you pass it?
@@osvaldoibarra8026 yes I did bro !!
@@lounesb9802 good job man hope you have a great day
@@lounesb9802how are you doing since then?
"With no coding!"
Within first minute, opens C#
No coding, assuming you already have the typical code in place for keyboard/mouse input 😁
@@sonofgragas8511 excuse me I have some unity question. somebody can help me?I am Taiwanese so my English is not well.
literally thank you so much every single unity/stack overflow article were making the solutions way more complicated than need be!!
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!!!
I've literally been searching for this for 2 weeks mow. Thanks
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.
Triggers, sticks and d-pad doesnt work for some reason. ..
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)
How to get joysick position? Like Input.mousePosition but for joysick
Will this also work in note pad I’m trying to change the controls for a mod
thank you! this helped a lot!
i almost completely switched the new input system and almost ruined my game thanks man😅
keep up the great work!
when my player flips the controls flip too im using a ball so it rotates the entire time
Good Tut, beautiful and apt.. great job you got here. 📌
will this work with netcode and online multiplayer?
thanks you are my new god
Which visual Studio are you using brother?
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??
Dont matter it works thx for THE amazing tutorial
Yoooo thank you my guy
KeyCode
dope Thank you!
Thank you :)
this is cool
thanks man thanks alot
thank you so much
excellent tutorial bro!!! :D
thank you very much!!! \(^.^)/
follow u in the street lol
cool
I subscrlbed
"No coding"
there is no coding
Thanks so much!