Unity Xbox Controller Joystick Input with Input Manager - Tutorial

  Рет қаралды 44,123

CouchFerret makes Games

CouchFerret makes Games

Күн бұрын

Пікірлер: 30
@CouchFerretmakesGames
@CouchFerretmakesGames 5 жыл бұрын
*Hey everyone!* 👏 👏 I'm happy to announce our community *Discord server* , come and *join us* : discord.gg/dac7sr2 And also, you can get all the *Sprites* and *Project Files* by supporting me on *Patreon* : www.patreon.com/CouchFerret
@peihenghuang7408
@peihenghuang7408 5 жыл бұрын
I am a Chinese university student, and I love your videos, which help me a lot about making my own games. These videos have been translated to Chinese shared on some Chinese video platforms, and almost everyone love them. Thanks a lot :)
@CouchFerretmakesGames
@CouchFerretmakesGames 5 жыл бұрын
I'm glad they help. :) Good luck on your games! Wow, that's soo coool! Could you give me a link or something? Or please let the translators know that I'm happy to work with them to create Chinese versions of the videos. :) Thank you!!
@peihenghuang7408
@peihenghuang7408 5 жыл бұрын
@@CouchFerretmakesGames He only translate your three videos, so I went to your channel to watch rest of them. www.bilibili.com/video/av55785086
@strobosaur
@strobosaur 4 жыл бұрын
Sir, i am in your debt. These tutorials are excellent!
@benbechia3582
@benbechia3582 3 жыл бұрын
Such a good turtorial man so good
@bobobobob2
@bobobobob2 4 жыл бұрын
Thank you! I wanted to make a Gamepad controls for my game, and this helped a lot!
@uber6604
@uber6604 3 жыл бұрын
Thank you so much!
@MrKiraBR
@MrKiraBR 3 жыл бұрын
Thank you soo much!!!!
@MrXRes
@MrXRes 6 жыл бұрын
Very nice :)
@user-em9su3dd9y
@user-em9su3dd9y 4 жыл бұрын
Awesome!
@lvdb2006
@lvdb2006 3 жыл бұрын
thank you so much! Btw: this also works with ps4 controller
@narwhaale
@narwhaale 3 жыл бұрын
how do you make it go faster I need help
@Alan742
@Alan742 2 жыл бұрын
It worked, but the controls are backwards
@SasisaPlays
@SasisaPlays 5 жыл бұрын
Will it work with dualshock 4? Yes it is.
@CouchFerretmakesGames
@CouchFerretmakesGames 5 жыл бұрын
Awesome! :)
@daleprather3026
@daleprather3026 4 жыл бұрын
Can you please explain why you're setting floats on your animator?
@alannahmernagh
@alannahmernagh 5 жыл бұрын
Nice tutorial, easy to follow. I have a question I am trying to set animation based on the position the player is moving based on a mouse click. The player will move in the direction the mouse is clicked, but the animation won't play. Are you able to tell from the code what is wrong? Thanks in advanced. void Update() { Vector2 movement = new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical")); if (Input.GetKeyDown(KeyCode.Mouse0)) { targetPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition); } anim.SetFloat("Horizontal", movement.x); anim.SetFloat("Vertical", movement.y); anim.SetFloat("Magnitude", movement.magnitude); transform.position = Vector2.MoveTowards(transform.position, targetPosition, Time.deltaTime * 5); }
@CouchFerretmakesGames
@CouchFerretmakesGames 5 жыл бұрын
Hey, thanks! The problem is that the movement vector you are using gets the values from either the wasd/arrow keys or a controller. And you've said that you want a point and click based movement. So, in this case, the movement vector is always a zero vector with both x,y and magnitude as 0s. You should be calculating the actual movement of the character between the current and the last frame and use this delta movement vector for the animation parameters.
@oguz-kagan
@oguz-kagan 6 жыл бұрын
would it work on mobile? i mean how can i make this kind of controller for mobile
@CouchFerretmakesGames
@CouchFerretmakesGames 6 жыл бұрын
There are a few assets (free as well), on the asset store that gives you on screen analog stick. And if you use them for the movement vector and the fire then I think it would work. Here, Brackeys has a cool video on this: kzbin.info/www/bejne/mKGVgZx8eJ6midU
@themotherland101
@themotherland101 3 жыл бұрын
how U do this if U no wan 2 animate???
@dc5285
@dc5285 6 жыл бұрын
same for ps4 controller ? i cant get it to work .he moves for a few secs then stops
@CouchFerretmakesGames
@CouchFerretmakesGames 6 жыл бұрын
That's weird. It should work, maybe the mapping will be different a bit but it should work. Does it say something or just stops silently?
@dc5285
@dc5285 6 жыл бұрын
@@CouchFerretmakesGames i cant remember if it said anything. Im pretty new to this but i got incontrol now so should be ok. i moved on and making it work with mouse and keyboard now following your other video so i unfortunately cant go back to find the problem. Thanks for the instant reply tho! Much appreciated
@CouchFerretmakesGames
@CouchFerretmakesGames 6 жыл бұрын
You’re welcome! Yep, an asset for universal input handling is a pretty huge time saver. :)
@susmitdas
@susmitdas 5 жыл бұрын
should I skip this vid because I don't have an xbox cortroller?
@CouchFerretmakesGames
@CouchFerretmakesGames 5 жыл бұрын
Well it won't hurt, but you can skip it yeah. In a more recent video I made mouse and keyboard controls.
@antari8016
@antari8016 6 жыл бұрын
I do not have an Xbox joystick, how to enter a fire on the keyboard.
@CouchFerretmakesGames
@CouchFerretmakesGames 6 жыл бұрын
Well, then you should use the default ones that Unity creates for every project. For the movement, you can use the "Horizontal" and "Vertical" and for firing you can use the "Fire1". All of them are in the list. By default, the movement will work with the arrow keys and WASD, and fire will be left mouse click and left ctrl. However, you can change them if you want.
Unity Running and Walking Animation Transition with Blend Tree - Tutorial
3:41
CouchFerret makes Games
Рет қаралды 25 М.
CONTROLLER INPUT in Unity!
16:44
Brackeys
Рет қаралды 377 М.
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
Unity's NEW input system in 13 minutes
13:02
BiteMe Games
Рет қаралды 38 М.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,4 МЛН
Unity Top Down Colliders and Character Movement - Tutorial
8:32
CouchFerret makes Games
Рет қаралды 201 М.
The right way to pause a game in Unity
9:09
Game Dev Beginner
Рет қаралды 64 М.
Use an XBOX Controller in Blender!
14:31
ScanningCars
Рет қаралды 11 М.
Unity's "NEW" Input System with C# Events
16:46
One Wheel Studio
Рет қаралды 94 М.
10 Minutes vs. 10 Years of Animation
19:29
Isto Inc.
Рет қаралды 1,6 МЛН