This one took a fair portion of time to put together so I hope people find it useful! Do be sure to comment below if you have any improvements, any suggestions on how to make sure others can implement input in great ways. I love to see it! Thanks everyone. :) 🕹Unity New Year Awards Sale NOW ON: bit.ly/UnitySalesHub 🕹BRAND NEW Quick-Start Bundle: bit.ly/UnityQuickStartBundle 🕹My Unity Store Assets: bit.ly/STUnityStorePuzzlePacks
@testpig Жыл бұрын
can you do a video with a top-down input system, that using mouse direction for facing direction, and and WASD for movement, while having the movement speed chance based on the direction your going against the position of the mouse. So walking backwards would be slower etc etc
@frankiejrey9 ай бұрын
This is a 5-star tutorial. Pure gold. Thank you for posting it.
@SpeedTutor9 ай бұрын
You're very welcome, my friend! :) What are you creating?
@frankiejrey9 ай бұрын
@@SpeedTutor Just learning for now. Placing a focus on FPS and you are helping.
@muzboz Жыл бұрын
It's great that you covered some of the essential extra stuff that is often overlooked, like having the default selected button for Gamepad, and if you switch from Gamepad to Mouse then back to Gamepad, to set a default button to highlight. Great stuff!
@SpeedTutor Жыл бұрын
You're very welcome and I'm glad you found it useful! It's something I've gone through myself, so I understand the pain of it all. What are you working on?
@YaKupitman9 ай бұрын
This video deserves MUCH more attention! Impressive work!
@SpeedTutor9 ай бұрын
I really appreciate that, my friend! :D What are you looking to create?
@YaKupitman9 ай бұрын
@@SpeedTutor I don't actually have any specific project that I'm currently working on. Well, I had some experience with creating small arcade games couple years ago, but I didn't have any idea how to write a clean expandable code. So here I am, trying to organise my thoughts and to improve my skills!
@monkeymonkey6969611 ай бұрын
Still didn't know why this video so little view Let's share this to everyone and support this video because this video is great Keep up the good work
@SpeedTutor11 ай бұрын
I really appreciate the support, my friend! :) My content just doesn't really get pushed by KZbin. I'm just thankful for the kind words!
@skydrowdev5 ай бұрын
Great tutorial. If the dropdown fix is not reflected in the editor, there's no need to delete the entire "Library" folder. You can just search the same file there and do the fix.
@SpeedTutor5 ай бұрын
Thanks for the tip, I really appreciate it! :D
@myowntreacherynz10 ай бұрын
By far the best tutorial on input system i've seen!!! thank you!
@SpeedTutor10 ай бұрын
You're very welcome and I'm glad you found it useful! :) What are you going to create?
@myowntreacherynz10 ай бұрын
i'm working on a 2d platformer with my 11 year old son :) very helpful tips thank you!@@SpeedTutor
@SpeedTutor10 ай бұрын
Awesome, good luck with your both! What a wonderful thing to do together but be scared when he becomes a better Game Dev :P
@agonyzx10 ай бұрын
Dear Speedtutor, first of all I want to really thank you from the bottom of my heart for this beautiful tutorial. I knew when you mentioned how to fix the input system editor, that this tutorial was basically all that one could ask for. But I still have a question, because you showed the implementation of a fps controller in depth, but do you have a similar in depth tutorial for a third person controller? I really like the way you explain things and hope you keep making great content :)
@SpeedTutor10 ай бұрын
I really appreciate you coming along to check this out and comment, my friend! :D As to that, I'll definitely put it down on my list but I highly recommend you check out Unity's third person controller templates that I linked, they can give you a good start as they do use cinemachine and such! :) What are you trying to create?
@agonyzx10 ай бұрын
@@SpeedTutor I appreciate your quick response, which further reinforces for me that this will now be my go to channel for unity content. I've looked at Unity's 3rd person controller, but it's set up a little differently than the setup you showed in your video. For example, there is no such InputHandler, but all roads lead to Rome, so I'll just try to create my own variation. I myself come from a full-time web development background and have always wanted to create a kind of minimalist Souls Like, but where I create almost everything myself (Unity, Blender, animations, etc.) This is the plan and also the reason why I don't want to use the Unity 3rd person controller, because I would like to be able to understand and use it from the ground up. Thanks again for your content. Please stay the way you are :)
@SpeedTutor10 ай бұрын
I really appreciate your kind words! It's the nature of this system, you're able to create the functionality in so many different ways. You wouldn't believe the amount of different controllers doing it all differently. It's crazy! Although one recommendation to you is Rewired, it's an asset from the Unity store but it's my go-to system. I've used it for the last 7 years or so and mirrors the older system more closely. I do have a full tutorial on setting it up too :)
@agonyzx9 ай бұрын
@@SpeedTutor Just another little problem I came across. I have the same setup as you do in the video and everything works, but as soon as I close my unity project and open it up again I'm greeted with the following error: NullReferenceException: Object reference not set to an instance of an object ThirdPersonController.HandleMovement () (at Assets/Scripts/ThirdPersonController.cs:43) ThirdPersonController.Update () (at Assets/Scripts/ThirdPersonController.cs:38) The problem is easily resolvable by removing the Player Input Handler Script from the Game Object and then re-adding it again right after. But it's a bit tedious to always do that after I close/restart my project. Do you have any idea what can be the cause of that?
@ShadowGamer-0007Ай бұрын
This helped me a lot, Thanka a bunch... I was like about to break my laptop...... but you saved it....!!!!!
@SpeedTutorАй бұрын
I'm glad you didn't break anything! :)
@ShadowGamer-0007Ай бұрын
@@SpeedTutor 😂but seriously , it helped me a lot, thanks again !!
@davidmiles2055 Жыл бұрын
Yay some nice and long tutorial! Teaching king is back! :)
@SpeedTutor Жыл бұрын
Thanks David! :)
@zelest11 ай бұрын
Thank you so much for this, especially the bugfix part in the beginning, it'd have driven me nuts! Amazing that it isn't fixed yet. I'd have pushed a minor update just for that.
@SpeedTutor11 ай бұрын
Supposedly they have created several fixes for it but with the various versions of pipelines, I guess it has slipped through the net. They are meant to be fixing it (Or have fixed it) in V1.7 or V1.8 of the input system. I don't recall the numbering, haha. No worries though, I'm glad I could help. What project are you working on?
@Danyul.4 ай бұрын
great idea randomly changing the code without saying anything at 25:47 great tutorial
@SpeedTutor4 ай бұрын
I can't remember changing any code but it might have been because of the edit
@jameslafritz286711 ай бұрын
One of the tricks that I use is the "Generate C# Class" option. You then use this (The Interface) in your Player controls singleton class instead. The nice thing about this is you do not have to manage the names yourself, and if you add/delete/change an action map it auto updates the code for you.
@SpeedTutor11 ай бұрын
Thanks for the suggestion :) How long have you been using the Newer input system?
@jameslafritz286711 ай бұрын
@SpeedTutor since it came out. It was originally a pain to use. Lots of great improvements since then like you said in the video I perfer to use both, the new input for the project and the old input fir quick debug testing/cheats to make testing easier
@SpeedTutor11 ай бұрын
I actually normally use Rewired if you've never tried it out :) Thanks for giving your thoughts though.
@jameslafritz286711 ай бұрын
@SpeedTutor I have heard of it. Haven't actually used it. At the time it appeared that it was similar to the new input system, so I went with the Free option. I am sure that it has developed over time and probably makes some things easier, probably more features than the new input system.
@jameslafritz286711 ай бұрын
Or maybe I am thinking of InControl.....
@ECnerdgamer7 күн бұрын
I'm not too sure about the handle rotation part: is that what controls the range of view or does it transform the player such that the capsule changes its x and z axis for the WASD movement? I'm using cinemachine's camera to handle the player's FoV and never made the look input mapping (as it could be intrinsically handled by the cinemachine component) and trying to move my character relative to the direction of view rather than the model. If the handle rotation is the method of which we determine the direction of movement, how would i know if my look sensitivity in code matches with cinemachine's look sensitivity? Do I still need to get raw mouse X delta and then find the right number to multiply to match my camera or is there a way to pull cinemachine's mouse X delta as my mouse X rotation
@gameswithelectron Жыл бұрын
Why are we finding InputActions if we can have reference using [serializedfield]?
@pliniojrm Жыл бұрын
@SpeedTutor, may you share the git for repository of this video?
@SpeedTutor Жыл бұрын
What repository are you speaking of? Sorry, it was a long video. Haha. Could you remind me, was it something I used in the video?
@pliniojrm Жыл бұрын
@@SpeedTutor the project source used in the video. I watched, but i'd like to see often the code. Having to find specific timestamp in the video just to find the reference of the project in the video is a bit tiresome. If you have saved the project of this video in a repository, would be great to access it for references. Have you not upload it to a git?
@SpeedTutor Жыл бұрын
Oh it's all on my Patreon, just like all the other scripts and projects. That's where all my content goes :)
@pliniojrm Жыл бұрын
@@SpeedTutor oh i understand. thank you for the reply though. Keep doing the good work! Cheers
@FyresGames Жыл бұрын
First of all great work on the tutorial for the new input system. There's one thing I would suggest for the Menu UI. Instead of using a update to detect if the mouse isn't selecting a button. I think a better solution would be to add on each button the component Event Trigger, add the event Pointer Exit linked to a function to keep the button it just left selected for gamepad or keyboard control.
@SpeedTutor Жыл бұрын
Thanks! And thank you very much for the suggestion, I like the optimisation and I really hope people read this and work that into their own solutions. I appreciate you taking the time to comment! :)
@owennurse5413Ай бұрын
Hi, great tutorial. I have one problem though when moving to this new system I can't figure out a good way to do GetButtonDown. I only want one call for when the jump button is pressed have doing it this way when performed happens it sets the bool to true meaning if I do an if statement in my player movement script the jump function gets call multiple times. Ik there are functions like callonframepressed and that performed are only called once but idk how to do getbuttondown using this input Handler manager. What would I need to do to make sure the jump is only triggered once?
@ACBros_06 Жыл бұрын
This vid was what I needed most. thank you for helping solo devs
@SpeedTutor Жыл бұрын
You're very welcome, my friend! :) What are you working on?
@ACBros_06 Жыл бұрын
@@SpeedTutor a URP mobile game utilizing input system to use a forklift truck and move boxes
@rageur1111 ай бұрын
Great tutorial ! I just have a question about the PlayerInputHandler script : why do you do the mapping by string (action map name and action reference name) instead of using an InputActionReference ? i find it way easier, and if you change the name of the actionmap or of the action, no modification have to be made in the code . ex : [SerializeField] private InputActionReference _moveActionReference; private InputAction _moveAction; private void Awake() { _moveAction= _moveActionReference.action; } is there a specific reason to pass by name ?
@SpeedTutor11 ай бұрын
That's a great suggestion, I made it very simple for people who have struggled to understand the system by giving them the most visually logical examples. I appreciate you coming along to comment because that's what I wanted, I want people to learn from everyone! :)
@africantrenor9 ай бұрын
I dont know if its just me getting all these errors... somebody please help, my code is exactly the same and everything gives errors
@africantrenor9 ай бұрын
my bad, im soopid, my code was funny, thanks for the tutorial!
@SpeedTutor9 ай бұрын
Haha, what happened?
@africantrenor9 ай бұрын
Happened that instead of keeping jumptrigger as a bool and sprintvalue as a float, I had them both as Vector2 bcs I was feeling funny lol
@SpeedTutor9 ай бұрын
Haha, you just wanted to make your own life more difficult :P
@africantrenor9 ай бұрын
I actually do have a problem, everything looks the same as in the video, but when I move the mouse, instead of moving the camera, it moved the player itself lol, and the joystick in gamepad, it only works left to right but not fornt and back, and the right stick doesnt move the camera at all
@PyranoTheDev3 ай бұрын
5:33 For the few of us using Linux and are possibly new to it, check the .config file and turn on Show Hidden Files if it isn't already on.
@SpeedTutor3 ай бұрын
Thanks for the advice! :D I appreciate your comment.
@kelcast877511 ай бұрын
Thanks for the video, it helped out a lot!
@SpeedTutor11 ай бұрын
Thanks for checking it out, what are you working on? :)
@kelcast877511 ай бұрын
Just a basic 2.5D platformer, trying to actually finish a project this time. I actually ran into an issue where the character would jump as long as pressed the jump button, I tried jumpAction.started but it continued the same (since jump wouldn't stop unless canceled). So I had to change the interaction in the Action Map to Hold and make it only start counting as performed after the button being pressed for .1 seconds and then did: jumpAction.started += context => JumpTriggered = true; jumpAction.performed += context => JumpTriggered = falsed; jumpAction.canceled+= context => JumpTriggered = false; Leaving this here just in case someone runs into the same issue.
@erdemkizil11 ай бұрын
@@kelcast8775 Thank you so much
@nicholasbrave111 ай бұрын
It would be awesome to see this expanded to include a local multiplayer setup!
@SpeedTutor11 ай бұрын
I could definitely have a thing about that!
@thunderstriketrading9 ай бұрын
This is acutally gold content! Game devs everywhere now have one less stress to worry about
@SpeedTutor9 ай бұрын
Haha, I'm glad you found it useful! :) What are you creating?
@BlackBladeDesign2 ай бұрын
Am I doing something wrong? the move and look values are always zero, but with debugging I can see they are triggered
@nicholasbrave111 ай бұрын
This is awesome, thank you
@SpeedTutor11 ай бұрын
You're very welcome, what are you making?
@AstralNostalgia Жыл бұрын
can you make an extra video of this using state machine? ... I still learning in INput System , but sometimes I found something odd with the state machine. so thanks, and amazing great tutorial.
@SpeedTutor Жыл бұрын
I'll see what I can do! Thanks for the suggestion!
@KyoryaZ14 күн бұрын
Very good tutorial, my only gripe is that you forgot to talk about how handle hold and toggle input.
@SpeedTutor14 күн бұрын
Thanks very much. Isn't hold the same as the sprinting logic? As you have to hold the key down for it to be constantly detected. As for toggle, isn't that the same as the regular click input?
@ZacharyHelm Жыл бұрын
Thanks for covering this! It is *still* the "new" input system, somehow. Did GGJ this past weekend and no one on my 6 person team was comfortable with Input System despite Unity being our most common ground for experience. imo the documentation/learning materials need to be iterated on and improved further. Quirks must be noted, etc.
@SpeedTutor Жыл бұрын
I completely agree on that. This input system is the most secret thing around, if they really want up-take. It needs to have really strong official documentation and videos on it. I've tried my best to cover a lot of bases in this video. As you can imagine, there are so many use cases and nuisances. Best of luck with the GGJ!
@Ingo.Mclean5 ай бұрын
@SpeedTutor when I was implementing a "snap" function (to be used to take screen shots with a spacebar press, so just like the "jump" function) I set up a debug.log in my FPS controller and I would get 5-20 console messages per Spacebar press. then I watched another video, and because the new input system has it's own messaging/event system and using the "Player Input" component, set to "send messages" the behavior window shows you the list of functions to make (all starting with "OnXXXX") to address messages received. So I made an OnSnap (Snap was the action name in the player map) in the SPSController script, and my debug message was only 1 line. Not sure why I had multiple messages using your method, but to me the OnActionName (with no need for the handler script) seems a lot less complex, more compact, and simpler to implement and manage. But I love your videos! PS: the other video I'm talking about is from DManGames called: Unity's New Input System: The Definitive Guide
@SpeedTutor5 ай бұрын
Thanks for the tips man! I really appreciate it. The input system seems to be one of these systems which can be implemented in so many ways and there is no "Official" way. Which I find frustrating. I just wanted to make this video a comprehensive guide, showcasing a lot of features nobody ever seems to touch on. Especially working with other types, UI's and various other aspects :)
@lucidedits99586 ай бұрын
hey man when im doing the FPS one for the camera its telling me that the "Top-level statements must precede namespace and type declarations." do you know how to fix this?? Edit: I fixed it but now im just flooded with a bunch of different errors despite me copying you exactly.
@SpeedTutor6 ай бұрын
Is your namespace at the top, before the class definition?
@lucidedits99586 ай бұрын
@@SpeedTutor yeah. I believe I fixed it but now im just getting a bunch more code errors.
@SamNBCA Жыл бұрын
A question? why are we reading the sprint as a float value rather than just a bool like jump? I'm not understanding the reasoning... and I want to. **Update: I think I figured it out... ...With the Jump we are just initiating the jump so we only need a quick input trigger, where as the sprint needs consistent input so that it continues to sprint when the button is held down. Basically the difference, between GetKey and GetKeyDown.
@SpeedTutor Жыл бұрын
You're exactly right, I mention it in the reference part at the beginning of the video. Needless to say, I appreciate you coming to watch and comment. Working on any projects?
@HellobozoFR9 ай бұрын
Hey, I’m very new to coding, and I’m having a little bit of an issue. At 15:08 when you start making the move action Equals player controls, for me, it shows the error CS0103 for sprint, move, jump, action map name, and look. Do you have an idea how I can fix this?
@SpeedTutor9 ай бұрын
Did you create the field for them? As in [SerializeField] private string sprint = "Sprint" and so on?
@HellobozoFR9 ай бұрын
Fixed it
@SpeedTutor9 ай бұрын
Awesome, how did you fix it?
@HellobozoFR9 ай бұрын
I just rewrote all of the code and it works this time
@Soulja_Man8 ай бұрын
quick question how would i make sprint a toggle?
@jcall19824 ай бұрын
As a beginner in Unity, this was one of the best tutorials I have watched hands down. Loved it. For anyone that might know, I'm unsure about a detail about the input handler. I had used another tutorial that set the input handler up with a singleton and used public events and public delegates.....and I have a number of scripts that reference that inputhandler.instance. The tutorial had me setting Script Execution Orders for everything since they are all calling for inputhandler in awake and (as I understand) this can be a problem if some other awake runs before the inputhandlers. (null ref problem) I'm thinking I need to rework it. from this video I would assume it is okay to just create it without public events/delegates and just access it throught the single public status instance and read values/use methods of that handler. Is that true? Thanks for any comments or guidance anyone might have! Trust me, it is greatly appreciated.
@SpeedTutor4 ай бұрын
You could definitely just do as you say, you shouldn't run into any major issues. Just make sure it persists and you don't lose connection through your scenes :)
@UfukDulger-iy5ez23 күн бұрын
i been looking for this dark theme error while thanx
@yours_indie_game_dev11 ай бұрын
you can just do player.move when u generate a c# class in staed of creating a string for move actoin. applies to other actions, there's a positive /negative1d biding in axis action type for 2d player to map A n D instead of usin vector2composite
@SpeedTutor11 ай бұрын
Thanks very much for the suggestion! I really appreciate that.
@VeGaDrOnE11 ай бұрын
Hi! I'm making a simple 2D space game with a top-down view where I control a spaceship, pick up packages, and deliver them to planets of matching colors. It's a simple project to better understand Unity and get my hands dirty. I want to put acceleration on the RT (Right Trigger) and rotation on the left joystick. Now, I can achieve this using the old input system with transform.translate() and transform.rotate(). Is there a way to bind these methods to the keys I want to use using the new input system? I've tried many things but can't get it to work. Any suggestions?
@JGCD218 ай бұрын
How do you transfer this into shooting guns? Is it the same input system code for it, I cant find an fps shooter tutorial with this new system.
@SpeedTutor8 ай бұрын
Yes it would be, just create an action for "Firing" or "Shooting" which would be a button and tie that to functionality which makes the shooting happen :)
@JGCD218 ай бұрын
@SpeedTutor Thanks! Great Tutorial!
@SpeedTutor8 ай бұрын
You're very welcome :)
@Vishmithj5 ай бұрын
Uh why is 'mouseSensitivity' adjusting the controller sensitivity and not the mouse? I can't find the reason at all... Also why is my mouse so sensitive in the first place? I followed your tutorial upto 33:23 and can't figure for the life of me why it happened..
@SpeedTutor5 ай бұрын
Did you add the correct processor for them?
@Vishmithj5 ай бұрын
@@SpeedTutor Oh. I was an idiot. I haven't set the processor for the Mouse. Now it is working fine! Thanks for the help!
@SpeedTutor5 ай бұрын
You're very welcome! :)
@erdemkizil11 ай бұрын
Hi @SpeedTutor. First of all, thank you for this lesson. I have a question. The player continues to jump as long as i hold the jump button. However I want the character to jump only once as long as i hold the jump button. How can I do that?
@SpeedTutor11 ай бұрын
Someone actually had this exact question recently, if you check down in the comments you should actually find it. The commenter actually posted a solution :)
@erdemkizil11 ай бұрын
@@SpeedTutor I missed the comment and finally i fixed my problem. Thank you so much again.
@SpeedTutor11 ай бұрын
Awesome, how did you fix it? Just so others can learn from you! Plus I always love to hear some solutions too. I refer back to comments often :)
@erdemkizil11 ай бұрын
@@SpeedTutor I added the following codes to the PlayerInputHandler script to create the GetKeyUp and GetKeyDown functions for the jump action: public bool JumpTriggeredPress { get; private set; } public bool JumpTriggeredRelease { get; private set; } private void Update() { JumpTriggeredPress = jumpAction.WasPressedThisFrame() == true; JumpTriggeredRelease = jumpAction.WasReleasedThisFrame() == true; }
@frankreiser_recaremo9 ай бұрын
Amazing - thanks a lot
@SpeedTutor9 ай бұрын
You're very welcome, what are you creating?
@frankreiser_recaremo9 ай бұрын
@@SpeedTutor a medieval reconstruction of my hometown. I tested some FPS assets but they all have some missing things. So I thought creating my own give me more understanding how it works. There is not a game more edutainment. I need no fighting and killing options. More discover real existing artefacts and interact with them, learn something real medieval life: food, working, craft, music, realistic buildings and so on. I just started to publish some free assets at Unity Store. Did you prefer uGUI or do you planing also making tutorials about UI-Toolkit? I like your work and how you teach us. Will looking at your tutorial shop soon.
@SpeedTutor9 ай бұрын
Sounds amazing and I wish you the best of luck with your project! I can't wait to see more. I pretty much always use the uGUI as it's something I'm most familiar with. I haven't experimented with the UI Toolkit yet but I may check that out! :)
@MikemoliOne4AllGaming8 ай бұрын
Very very good tutorial, ¡great job and thank you!
@SpeedTutor8 ай бұрын
You're very welcome, what are you making?
@aayan_tanvir Жыл бұрын
still at the intro, but i know this is going to be a banger and teach me alot of things. I wish that after finishing this i can have enough knowledge to make a controller myself.
@SpeedTutor Жыл бұрын
I hope you find it useful and it helps you out. Of course, it's only the start of getting your ideas together as input is a long process. Haha.
@aayan_tanvir Жыл бұрын
@@SpeedTutor yup! Thanks for these videos bud!
@snoozybara2 ай бұрын
Thanks for the tutorial on input system. It is very helpful! I have a question about don't destroy on load. If the instance is already null, why would the game object be destroyed? Is the game object and instance different?
@SpeedTutor2 ай бұрын
The instance just means it's a copy of the object. :)
@snoozybara2 ай бұрын
@@SpeedTutor I see! And I think this line is necessary because if the game loads a different scene, all objects will be destroyed right? And we want to preserve this input handler object even if we switch scene.
@finalkill5 ай бұрын
Hey man, can you help me with my code? My C# says: “The name ‘PlayerInputHandler’ does not exist in the current context”
@SpeedTutor5 ай бұрын
Is your class name the same as your script name?
@finalkill5 ай бұрын
Now that you say it…😅
@thecrin58439 ай бұрын
Hello, a question, ui toolkit is not yet compatible with input system? Because now I'm seeing that for el.menu to work with that tool, you first need the mouse Click for the control to respond,Seeing this, does it mean that it is still advisable to continue using the old UI?
@SpeedTutor9 ай бұрын
I always recommend using features that are fully supported across their tools, rather than things that are still at the fairly early adaption stage. Just because you're often missing use cases and there may be other things that you find a long the way. :)
@pkmnjourney11 ай бұрын
Thanks for thr tutorial it really helped a lot. Unfortunatley Im facing an issue where the controller doesnt work after building the game. Keyboard and controller work great in editor but after building only the keyboard and mouse work :(
@SpeedTutor11 ай бұрын
That's strange, did you Google the issue?
@pkmnjourney11 ай бұрын
@@SpeedTutorive done some further debugging and it turns out it was due to the steam integration requiring steam input i disables the steam integration temporarily and it works now. Thank you 😊
@SpeedAmo1211 ай бұрын
i keep on getting errors when i do the Instance = this; it is saying that this is not a thing
@SpeedTutor11 ай бұрын
Did you need any capitals in the words?
@SpeedAmo1211 ай бұрын
i basically copied what you did and sometimes it kept giving me errors that should not be there@@SpeedTutor
@bruceu70486 ай бұрын
Good tutorial, but still can you tell, why you doesn't use a generated C# class? Isn't it easier for code or it maybe slower? I just asking cause don't know which to better for using and prefer on that. Thanks.
@SpeedTutor6 ай бұрын
You can use that if you'd like, I was just showing everything step by step so people could understand fully :)
@ASoulsShadow4 ай бұрын
I have an error in the player script where every time i save/build my project it cant find the player manager script but if I duplicate the player manager script it works fine but I would like a fix so when i build the game it just works. anyone know how to fix this?
@SpeedTutor4 ай бұрын
Try and use GameObjectFindWithTag and make sure your player manager has a tag you're looking for. Then this could find the appropriate script on start :)
@ASoulsShadow4 ай бұрын
@@SpeedTutor how would i add it i have been trying to add it as a replacement to the private PlayerInputHandler inputHandler; by putting GameObject inputHandler = GameObject.FindGameObjectWithTag("InputHandlerTag"); but i keep getting errors and i dont know how to fix them
@RebrandSoon00008 ай бұрын
Great tutorial, gonna look into the Patreon as soon as I can get some $ going. I do notice if I make a cube and make it big enough for the FPS controller to be on, I fall through the other side like I'm flipped.
@SpeedTutor8 ай бұрын
I really appreciate that, my friend :) I'm not sure what you mean about the cube? What are you using it for? Does it have a collider on it? That would stop you falling through :)
@RebrandSoon00008 ай бұрын
@@SpeedTutor I think I figured that part out, my issue is, if I use the mouse to move, like I made a plane with a collider on it, and 2 boxes to jump on with a box collider. If I move with the mouse or stick, i just get kicked off it for some reason.
@kevz_149 ай бұрын
Erm... my look up or down rotation doesnt work. Also my character is very jittery in the y axis. staying still and its like its had 20L of coffee
@pim-expert10 ай бұрын
Great tutorial, thank you. I spent a lot of time going around in circles until I followed this step by step, and translated it into my requirements. One thing I am still struggling with is changing the context of the keys when I go from game to in-game menu (game still running in background). For example, Spacebar has a different purpose. I tried to use .SwitchcurrentActionMap() but it gets itself in a mess. Togglong between two maps ends up with both being disabled. Have you any tips on this, or would you use a different approach to switching contexts?
@SpeedTutor10 ай бұрын
I can see what problem you might have, my only appropriate would be to disable other components that don't need to function when on your menu. So therefore no other inputs would matter. I can't give a more concrete solution because I have used this system for every situation, as there are hundreds of different minor use cases. Do let me know if you find a good work around though! :) Thanks for watching.
@castlecodersltd9 ай бұрын
A really great tutorial. 🙂 I have one bug when reconnecting a controller (generic Xbox Controller). I get the reconnect message - excellent, but then I get an immediate disconnect for the same device which means my dialog pops up again 😞. Any idea why this might be please?
@SpeedTutor9 ай бұрын
I wish I could give you a more concrete answer on that because it didn't happen to me but could be worth googling or throwing it into some AI for some tips?
@Gr3gYx10 ай бұрын
Hey! Nice tutorial, I'm going to use this to learn, but I have a question: Do you have an example of implementing the "ONLOOK" function for a 2D top-down shooter-esque game? I cannot find an example for that anywhere. I want to be able to use my mouse to shoot wherever I'm pointing at, and maybe a controller to aim and shoot in the right stick direction 🙄
@SpeedTutor10 ай бұрын
You'd most likely want to create a raycast to your mouse position and then have the logic within that :)
@bsdrago Жыл бұрын
incredible!! Congrats!
@SpeedTutor Жыл бұрын
You're very welcome, I hope you find it useful! :)
@Squatch-A-Toon11 ай бұрын
Anyone having trouble with the look not working with the mouse? When I enter play mode to test eh mouse will not register data and move the camera accordingly, but when using a controller(gamePad) the camera works perfectly. would anyone know what the problem might be? the code and Input map are set up to the same way as in the video.
@SpeedTutor11 ай бұрын
You're using Mouse(Delta)?
@Squatch-A-Toon11 ай бұрын
@@SpeedTutor As the binding in the Input Action map when setting up the inputs for the mouse look action. Which the look action is taking in the Vector2 Value. In Handle Rotation() the code is the same as in the video.
@Squatch-A-Toon11 ай бұрын
@@SpeedTutor Did some Extra Playing around and it was something wrong with how I set up the character GameObject in the scene. Had to create a second player and it worked fine on the second one. Possible because I had the PlayerInput Action Map on the Player Object and maybe that caused the issue because when I removed it the original Player object worked.
@WyMustIGo8 ай бұрын
Have they fixed the bug that you discuss in the beginning?
@SpeedTutor8 ай бұрын
I'm not sure about that one, as I haven't tried to update the package yet.
@SS-eq4nt6 ай бұрын
Holy crap, thank you for helping fix this stupid bug in Unity. 😅
@SpeedTutor6 ай бұрын
Haha, you're very welcome! :D
@ArnoldSzathmary10 ай бұрын
This is genius! The spelling mistake is still there. Unbelievable!
@SpeedTutor10 ай бұрын
I know, it's crazy that it isn't fixed at this point but you're very welcome. I hope you found it useful. What are you creating?
@melanieconners75939 ай бұрын
Hi and sorry if this is a stupid question. I did everything for movement (am at part of Testing the fps controller) and everything works really, its really amazing. I did that 2 days ago. I reloaded my project today and when I try to move now, I keep getting a NullReferenceException and I didn't touch anything, only play button. Would you happen to know why? I tried a few things to fix it but I am still very new to programming.
@SpeedTutor9 ай бұрын
You might want to move the GetComponent reference to the start method? If it isn't already, as it might be trying to find it before it exists :)
@Digildon11 ай бұрын
thanks
@SpeedTutor10 ай бұрын
What are you working on?
@Digildon10 ай бұрын
@@SpeedTutor eh, lots of small, never see their end projects, at least now they will be with a normal input system. You can see my latest work on my youtube channel if you are interested.
@SpeedTutor10 ай бұрын
Awesome, I'll take a look!
@marcospaulo669711 ай бұрын
my inputs are working, but thay doesn't update while i'm playing, meaning that i cant change directions once i start walking. what did i do wrong? Great tutorial btw Figured out! Edit :figured it out, it was because of the hold and tap parameters, in this mater, should i add a new config in the playerInputHandler, for all new parameters i want to add?
@jcashbeatzrh5 ай бұрын
Great Tutorial! I'm just having a bit of trouble with my Camera. I can rotate but I can't look up or down. Not sure why. Will try and figure it out. Thanks again learned so much! subbed! ERROR: MissingComponentException: There is no 'Camera' attached to the "David" game object, but a script is trying to access it. You probably need to add a Camera to the game object "David". Or your script needs to check if the component is attached before using it.
@jcashbeatzrh5 ай бұрын
FIxed it! I used GetComponent instead of putting mainCamera = Camera.main
@SpeedTutor5 ай бұрын
Haha, nice one you've already fixed it! Thanks for checking out the video and I appreciate it. What are you creating?
@jcashbeatzrh5 ай бұрын
@@SpeedTutor Thank you for uploading quality content! But I'm working on a multiplayer fps.
@SpeedTutor5 ай бұрын
You're very welcome, how's progress?
@jcashbeatzrh5 ай бұрын
@@SpeedTutor Just started this week. But I've got my player moving, animating and shooting. Obviously still need more refinement but I'm liking the results so far.
@Angel-xp1jy7 ай бұрын
dang, unity really did it overcomplicated , you will have to write 50 lines of code, before even start using the new input system :D, thank you for this tutorial, we will need it!
@SpeedTutor7 ай бұрын
Haha, good luck with it! :) Once you have the base, it moves fairly quickly :)
@emircykman_music10 ай бұрын
0:04 That's me since i decided to switch to the new Input System. (I know it's worth it, though).
@SpeedTutor10 ай бұрын
Haha, I know how you feel - Many, many do! :) Are you feeling more confident yet?
@emircykman_music10 ай бұрын
@@SpeedTutor well.. to be honest, it'll take me some time to get used to it haha. And by the way, this video is has been very helpful, so thank you!! I'm definitely subscribing :)
@SpeedTutor10 ай бұрын
Thanks man, I really appreciate it and best of luck with your project(s)
@CuriousWithCoding8 ай бұрын
Hi, good informative video. I think there may be an error in your playerInputHandler. I am relatively new to unity and c# but I think when you call Destroy(gameObject) in the else block within Awake(), you need to check all actions are not null within OnDisable(). The reason for this is that if the code is run sequentially then moveAction and the rest are never instantiated when a new object is being checked and removed by your code. Thus, will cause an exception within OnDisable() which is called by Destroy(gameObject). I think this comment makes sense. Of course I could be wrong.
@SpeedTutor8 ай бұрын
If you're referring to when I specify an instance and use Destroy, that's just to stop the system from making duplicates of that gameobject if we moved scenes. It makes sure we only ever have one :)
@CuriousWithCoding8 ай бұрын
Thanks for the friendly reply. :) I understand the purpose of the code. I was referring to when the scene changes and that duplicate is destroyed. The Destroy() method will call OnDisable(). I think OnDisable () needs to check that the objects within it are not null because your code will call OnDisable() before the objects that OnDisable() use are assigned a reference. I think this error will only occur when a duplicate is created. But I am not sure if it would cause the game to stop working.
Ай бұрын
Is your mouse like 5 DPI?
@SpeedTutorАй бұрын
Actually 2 DPI!
@SuperMillwall11 ай бұрын
I’m having an issue where I close the project and open it back up I have the following error message… NullReferenceException: Object reference not set to an instance of an object When I click it, it says the following… NullReferenceException: Object reference not set to an instance of an object FPSController.HandleMovement () (at Assets/Scripts/FPSController.cs.41) FPSController.Update () (at Assets/Scripts/FPSController.cs:35) The code on line 41 is the following float speed = walkSpeed * (inputHandler.SprintValue > 0 ? sprintMultiplier : 1f); The line on 35 is… HandleMovement (); Do you have any idea what I need to do to get this to work? Like I said, it was working perfectly fine when I first followed your video but once I closed the project and opened it back up, I have this error and I can’t play test anything. Any help would be appreciated!
@SpeedTutor11 ай бұрын
Where do you have the singleton creation in your manager script? In Start or Awake?
Im having same issue and cant figure it out, any update on this problem?
@seva424111 ай бұрын
EDIT: I figured out the issue. It is due to the execution order. The singleton is being created in the Awake method, while the FPSController is setting reference to it in the Awake method aswell. Change the FPSController from Awake() to Start() and it solves it. You could also change the execution order manually, or figure out a different solution i'm sure but this is what I did.
@SGUDevs7 ай бұрын
watchout avoid adding model into FPS it will give you errors due to animation being used instead of programming locomotion data will be stuck trying to figure it out for 3 days
@gmangman123 Жыл бұрын
wooww very long tutorial my friend.
@SpeedTutor Жыл бұрын
Haha, it is but I wanted to cover most of the important topics for people. :)
download the first person and third person controllers spend time analyzing them and then try your own out
@SpeedTutor8 ай бұрын
Always a great suggestion! :)
@stylie473joker5 Жыл бұрын
I appreciate the amount of work and effort you put into your videos thank you btw does this cover how to detect if a controller is being used at the moment or a keyboard and mouse so that i switch the Ui button prompts to use Controller ones or M&K prompts ?
@SpeedTutor Жыл бұрын
I do have a part which lets you know when take control with the mouse and then try and use a gamepad again, find the UI navigation again.
@nutsandy7183 Жыл бұрын
Im sure its a great help and appreciated. But i still dont get why the new one is supposedly better than the old one
@SpeedTutor Жыл бұрын
It's because you can control the buttons you use for both gamepad and other inputs, in a more usable way. As the old input system was pretty limited for multiple options like console.
@lmao01 Жыл бұрын
I was looking for few information if my approach in code is correct but didn't find it here unfortuantely. It doesnt cover cases where ui overlaps and you want to trigger something from ui without ie firing. What if the ui should only block particular actions but still allow other ie. movement. Every action here is coupled together to your input handler. I'm not sure why would you do this when you are just setting the values here. After a while input handler will hold 50 properties where there would be no reason to not just store them on the component (even more so next to InputActionReference). If you would like to migrate/extend script ie. speed based difficulty you will have to either hook it in input handler or have two places that handle this speed creating confusion. Even more so when more things will guide the speed. There shouldnt be needed a reason why everything needs to know about input handler manager reference. While there is many yt devs creating input system tutorials I never see a case covering more complex cases so unfortunately this will blend with water. Although I'm just a random opinion guy, I'm still sure that this will help many devs so keep up the good work!
@SpeedTutor Жыл бұрын
No, no. You're very welcome to your opinions and I asked for them too. I think it's important to get as many perspectives as possible. As I mention that the input system can be used, programmed and implemented in so many different ways. I was just trying to do a blanket tutorial on most of the common things people struggle with when it comes to input. The problem with more nuanced UI examples, it's very project dependant. You could spend 10 hours easily covering different scenarios and it still wouldn't be enough but I really do hope you find or work out everything out. Myself, I use Rewired from the Unity store because it is a really robust system.
@random_precision_software Жыл бұрын
What was that path name i have to go too to fix the bug ? Lol only joking
@SpeedTutor Жыл бұрын
Haha, I couldn't fit that in the description but here's the file path if you did need it: C:\Users\{user}\AppData\Local\Unity\cache\packages\packages.unity.com\com.unity.inputsystem@1.7.0\InputSystem\Editor\Internal\AdvancedDropdown\AdvancedDropdownGUI.cs
@random_precision_software Жыл бұрын
@@SpeedTutorthnx, did you read my Shopify problem, can you sell digital products like Games in a Zipped folder?
@SpeedTutor Жыл бұрын
Oh I didn't realise you gave a question about that. Yes you can, you just need to upload using their download add on. I think :)
@random_precision_software Жыл бұрын
Yes it think I saw a video on that.. Thnx@@SpeedTutor
@SondaPower Жыл бұрын
Hi, what program do you use for recording? because you have wrong settings or something because is bad quality when zoomed in. I am trying to help as you helped me and others 😁😁
@SpeedTutor Жыл бұрын
I'm using OBS but my resolution is 1440p and I downscale to 1080p because of the size difference. You think I should change?
@gameswithelectron Жыл бұрын
@@SpeedTutor Yes, text is kind of blurry as compared to other yt tutorials.
@HERBANLEGENDSifyАй бұрын
This may be a stupid question but it's one that is tripping me up badly. I notice that you print the device by accessing the InputSystem.devices. This always throws an error for me. I am using the correct name space UnityEngine.InputSystem; however, it keeps saying that an object reference is needed to access the non-static field. Even when I use your exact PrintDevice() method it throws the same error. I thought the InputSystem.devices was globally accessible. What could I be doing differently?
@SpeedTutorАй бұрын
What line is it referring to? And what does that line look like exactly? Do you have the instance reference find in Start or Awake?
@HERBANLEGENDSifyАй бұрын
@SpeedTutor sooo... i figured it out. When I was first learning the new input system, I created an InputActionAsset called InputAction and had it generate the c#class. In my naivety, I wasn't familiar with all the naming conventions in unitys new input system. Obviously, this was in conflict with some of the built in systems and ultimately was the problem. Silly problem to have but hopefully others can avoid the same mistake. Interestingly enough it was generating the c# class that was the issue. The InputActionAsset name by itself did not cause a problem.
@SpeedTutorАй бұрын
Good job on fixing it! :D
@glenfoxh Жыл бұрын
I give great thanks to Unity for making simple coding mechanics vastly more complicated for game programmers. And changing how we code things once again, so our old program code no longer work at all. Is par for working with Unity. Noting new there. This info only helps me to see I made the right choice in dropping Unity, and going to Unreal.
@SpeedTutor Жыл бұрын
I'm glad that you're having a good experience in Unreal! Whatever helps you make the best games possible, is all you can ask for. Best of luck with your projects.
@glenfoxh Жыл бұрын
@@SpeedTutor What ever helps. That is the truth. ^.^ I'd never say anyone was doing something wrong for wanting it use Unity, mostly if they made something good with it, or at least felt they could. Despite how good a program Unity is, With the way the devs have handled it, that is with how updates often broke my works, and paid for assets, among other things I felt was not good, trying to use Unity had left a bad taste in my mouth. I know full well Unity is a good program, for plenty have made some good games with it already. Games I have enjoyed playing. But its level of instability however is just not for me. Yeah, Unreal is indeed that, unreal. It's large yet stable, even when it's updated. And that is very important to me, for there is a longer learning curve to learn something that massive than it takes to learn Unity, aside form the basics, it not be good for by the time I have learned how to use it, how it works changes in a way, it no longer works that way anymore, as had been the case with Unity. I give much credit to those that have had success with Unity. They are certainly better developers than I am. ^.^
@Actio833 ай бұрын
This new system just feels like overengineering like crazy...
@rogercotton51344 ай бұрын
They should call it 'Input System 2024'.
@TheJoyBoySSK8 ай бұрын
Didn't understand at all lol, you're explanation and everything was professional but it's just that a certain dumb**s here happens to be a beginner 😂. Would be happy if someone gave a starting point on how to reach a point to understand this video 😵
@SpeedTutor8 ай бұрын
Haha, you could start with some beginner C# tutorials maybe? You just need to get to grip with a few basics really :) The newer input system is quite complex. I have a series on my channel and various others.
@TheJoyBoySSK8 ай бұрын
@@SpeedTutor certainly will start by them, when it comes to creative programming like these stuff involved in games, I haven't trained my brain to think that way yet, Thanks for the tip and can you make a vid of unity for dummies cuz with the amount of professionalism and industry level your content is I can really see a proper guiding light shine in that context for PPL like me!
@SpeedTutor8 ай бұрын
I do have a basic C# series and a few other basic tutorial series too! :) If I were you, I'd try and complete some really little projects and accomplish those tasks, little by little. It's the small progressions which really drive you forward.
@TheJoyBoySSK8 ай бұрын
@@SpeedTutor Great! I'm starting on your series as base and will do some standalone projects. I'll keep on updating my progress in comments
@amogh21015 ай бұрын
This feels overly complicated. I've seen other tutorials enable these functionalities relatively quicker and simpler. Nonetheless, I appreciate the latter portion of the tutorial where you dive deeper into processors and interactors.
@SpeedTutor5 ай бұрын
I wanted to go into as much details as possible so everyone could get into it at any level. I'm glad you took the time to look at the other parts because all of that is severely over looked and not covered.
@jegalevujegaleway-k5e3 ай бұрын
Speed tutor - 1h - ok
@SpeedTutor3 ай бұрын
You try and get that type of tutorial done in less time, I showed a hell of a lot of different aspects of the input system.
@jegalevujegaleway-k5e2 ай бұрын
@@SpeedTutor your tutor amazing, bro!
@thecolorred836826 күн бұрын
Stop! Updating! Unity!
@SpeedTutor26 күн бұрын
Who? Me?
@thecolorred836826 күн бұрын
@SpeedTutor No. Every time that I boot up unity and try to learn how it works, everything is different, and all of the tutorials are outdated.
@SpeedTutor26 күн бұрын
The concepts should still apply, mostly. As the newest version in Unity 6 was very similar when I last used it. :)
@svedalawoodcrafts6 ай бұрын
This new input system is total garbage!
@SpeedTutor6 ай бұрын
Not a big fan?
@svedalawoodcrafts6 ай бұрын
@@SpeedTutor I am a huge fan of your video's but the new input system is just terrible lol. I still use it but it is still very buggy.
@SpeedTutor6 ай бұрын
I agree, it would be nice for them to really fine tune the full thing. I appreciate the kind words!
@KUKY7cz5 ай бұрын
We are currently over 6 months into waiting for a grammar fix by adding an 'R' to a particular line that has been floating around the internet. More and more I want to run to Unreal, maybe it will be better.
@SpeedTutor5 ай бұрын
Haha, is that still not fixed? I swear it was meant to be fixed at this point. I'll try and follow that up.
@Andrashh7 ай бұрын
What should I do if I want jumpAction to be performed only once even when I hold down space? My current solution is to put xx.Jump.triggered in Update but this feels like a workaround. Not a solid solution.
@SpeedTutor7 ай бұрын
What happens if you don't?
@Andrashh7 ай бұрын
@@SpeedTutor If I'm not holding down, just pressing, it still gives too much true statments thus using jump multiple times. If that's what you mean.
@velkyngame10 ай бұрын
Thanks for this! Best up-to-date Input System tutorial on KZbin
@SpeedTutor10 ай бұрын
I'm not sure on the exact right and wrongs in this case, there might be slightly downsides in terms of performance but ultimately you need to get something that you understand and what works for you. So if it works and you don't see any major impacts, go with it. You can always change things up, if issues arise :) Sorry that's not definitive but I don't know the exact ins and outs :)
@velkyngame10 ай бұрын
@@SpeedTutor Thank you, really appreciate your reply :)
@SpeedTutor10 ай бұрын
You're very welcome, my friend. What are you creating?
@velkyngame10 ай бұрын
@@SpeedTutor Working on an action-adventure game and currently reworking my character controller. This is the reason your tutorial was uploaded at the perfect time haha. I really love how you interact with your audience. But man, that seems stressful! Hope you get some rest!