3RD PERSON CONTROLLER in Unity - Input System
HTML-код
- Опубликовано: 27 сен 2024
- In this video (Episode 1) will implement Unity's new input system, and create our inputs that will handle our player's movement!
► PLAYER MODEL & ANIMATIONS
drive.google.c...
► JOIN OUR DISCORD
/ discord
► SUPPORT ME ON PATREON!
/ sebastiangraves
► ASSET STORE PAGE (Animations & Models)
assetstore.uni...
► FOLLOW ME IN INSTAGRAM!
/ tragicallycanadian
► EPISODE 2
• 3RD PERSON CONTROLLER ...
For people doing this in 2022+ at around the 2 minute mark when he is going over bindings, the "2dVector" type has been renamed to "add up/down/left/right composite"
So helpful thank you very much
hmm seems they renamed it again?
ahh got it had to set actiontype to value and control type to vector2 first
don't use values use passthrough else your player never stops moving
Thanks
I completed your Darksouls Locomotion chapters and had a few issues as i'm new to Unity, I then followed your 3rd Person survival Horror Locomotion and managed to successfully follow that, now I'm following these series so I can really grasp these basic principles before I move on. It has been extremely helpful to learn a lot of the concepts that i've been attempting, such as referencing other c# scripts and having them work together almost like modules, having root motion or not and organising my scripts effectively with almost 'on the job' learning on how to use the language. You've really helped me learn a lot the past week! Thank you for creating such informative and helpful videos.
no joke me too lol
Hey i have a question. Can I implement weapon scripts and stuff from darksouls videos into this new 3rd person controller?
If I could like this video more than once for the "RUclips algorithm gods" I totally would. These are exactly the kind of straight up, no-bullsh*t "How to do this or that" tutorials I was looking for. Me and my already-too-high blood pressure are very grateful.
I have watch all videos on unity and tried to learn unity and make a controller . Your the only one that made sense. I was about to give up on making games. Thanks for giving me motivation to continue.
many tutorial is good to understand programming, but old version.
You can even buy courses in udemy. Dont give up
This is One Of the the best channel i ever have found. The way you teach is so simple keep it up it helps alot of people to understand game development.
Best tutorial for the new input system out there, hands down! I spent 2 hours wasting my time on other vids before this.
I feel like the line playerControls.PlayerMovement.Movement.performed += i => movementInput = i.ReadValue(); wasn't explained very well. Also I feel like i is not a very good name since i is of type InputAction.CallbackContext. A better name would be context or rather it would be more clear if you actually wrote out the callback function instead of using a lambda. Correct me if I'm wrong, but I had to watch some other videos to really understand what was going on in that line of code. I would recommend you slow down a bit and explain some of the nuances.
Exactly my boy, i had trouble to understand this code
How did it take me this long to find your content! Very nice tutorial and layout of the new input system this video alone could get anyone started, I look forward to the rest of the videos.
Thank you John!
I came here after trying your Dark Souls episode 1 because I could copy the script but the logic was very difficult to follow. This video has been a huge help for learning the Input system, thank you.
Wish I found these videos of yours earlier, I would save myself a lot of time. Thank you!
something isn't working because when I put PlayerControls into my script it comes up saying it doesn't exist
(I have generated the script btw)
really good tutorial as always man, one more like and comment for the algorythmes god because you deserve to be more know over the world. I'm gonna use this serie to make a template for most of my 3rd person projects!
You are too kind! Thank you my friend.
When I get to the end and I test out the inputs, pressing WASD doesn't change the values in the input manager. I've checked and redone the tutorial a couple times and my code seems to be perfect, so what's the issue?
It happened to me as well. If you name your script Input Manager, with a space between the 't' and the 'M' that causes a problem because when the class is made, there is no space in 'InputManager'. In other words, there is no reference to 'Input Manager', but there is one to 'InputManager'.
Delete the script, create it without the space, and it should work.
My God! This is my oversight, I didn't pay attention to building the manager initially, sir, you are beautiful!
So far so good, best explanation of this new user input system I've heard so far!
Really happy it helped you out!
hay i am new to unity at 3:37 when you set that player controls reference(that variable) it not working it does not shows as a variable there is nothing can you help
The OnEnable stuff is not apearing for me
So, I followed every step in the video, but the inputManager isnt changing any values
Did you ever find a fix?
sadly, no@@traynorth83
Very Detailed
Hey would anyone be able to explain "playerControls.PlayerMovement.Movement.performed += i => movementInput = i.ReadValue();" in more detail? I'm still very new to game dev and I want to know more about what the different pieces do so I can use it in the future, or what to look up in the documentation to get more information about it.
+= is just used for subscribing the event delegate, u will understand better once you watch some event n delegates, they are really easy
bro i have error like this Object reference not set to an instance of an object
@@Rahulsingh-theraha
You are explaining very well, waiting for your videos!
I really don't see how it's better than the old input system... looks so complicated for a simple job xD
It's universal. It's agnostic input code that can be applied cross platform regardless of the major differences in input systems with very little effort once the initial setup is complete.
Hi sebastian, would you happen to know the reason why my c# script cannot detect the PlayerControls at all? non of the lines turn green as it happens to you despite following this video step by step
im having issues with the Null and playerControls section, did you figure it out?
This is really good. Either you are too quick for me or I'm just not ready for this. Back to "Hello world" I go.
Assets\inputManager.cs(17,43): error CS1061: 'PlayerControls.PlayerMovementActions' does not contain a definition for 'Movement' and no accessible extension method 'Movement' accepting a first argument of type 'PlayerControls.PlayerMovementActions' could be found (are you missing a using directive or an assembly reference?)
what does this mean and how can i fix it?
I know this is a year late, and I really hope you have found a solution by now, but in case you have not, this is your problem.
You have
'PlayerControls.PlayerMovementActions.Movement'
First, you chose to say PlayerMovementActions instead of just PlayerMovement, you probably did it because thats what the autofill said to put. but the reason why autofill said to add 'Actions" was because you capitalized P in PlayerControls, which means that unity is trying to read from the class instead of from your instance of the class.
So the code should be
'playerControls.PlayerMovement.Movement'
i gave myself a pat on the back without you telling me to, i hope that's okay with you!
Finally someone who makes understandable tutorials
Assets\inputmanager.cs(7,5): error CS0246: The type or namespace name 'PlayerControls' could not be found (are you missing a using directive or an assembly reference?
help please
Are you sure you pressed "Generate C# script" in the input map?
Why does the tutorial video portion stop at the 6:50 mark? It's just audio after that and your avatar?
Because he's not explaining how to do anything anymore at that point, he is just doing commentary on what we did and what the next one will cover
For me this happens The type or namespace name 'PlayerControls' could not be found (are you missing a using directive or an assembly reference?)
It's great how the new player input system does the same thing Unity has always been doing, but now it is 10x more complex.
the 2d vector composite is now named: Add/up/down/left/right composite
this series is helping me so much, thank you so much for the high quality content for free!
Super happy to hear it has been helpful!
You're really helping me! Thanks!
Nah man I found a new Bracket that can teach! Thank you Sebastian
Came from dark souls series. I am new to unity so this is really useful! Thank you.
I dont get the OnEnable thing and how did you get Private Void OnEnable?
Bro, will you marry me?? This series is so helpful. I like how you actually explain the code you’re writing, rather just basically telling everyone to copy what you’ve got and nothing else
One of the best tutorial i've ever seen. You get new subscribe ! thanks
Thanks for making this kind of video, now I understand how it works :]
Thank you very much for the excellent video, I will follow this playlist
my visual studio never give any of those recommended phrases like he gets and activates I get different crap showing up that isn't anything like what im typing.
you have to link it to unity i forgot how but you can surch up a totorial
Excellent tutorial format!
I accidentally made myself jump to the moon
For those who have an error "the type or namespace player controls couldnot be found" click on the player controller input actions and generate c# script
Goated. i was looking at antoher input tutorial and the guy didnt' even mention how to add the up left right down system.
at 4:31 my code said that PlayerControls had no definition for PlayerMovement and I don't know what to do to fix it
Whenever I try running the game after adding the input manager there's never any changes to the movement input values. All of my code matches yours and the names match up. I'm not getting any error messages for it the values just won't change. What should I do?
I'm getting the same thing
i know this is old but im struggling- did you find a solution?
I also am having the same problem... I don't know what to do.
Wonderful tutorial, thank you so much
I understood everything except what "i" means? This tutorial is very helpful
Lol, btw lets collab developing games alone feels kinda alone...
@@ShatabdaRoy115 I am ready
From my understanding I is just a normal variable name. It can be anything
@@ShatabdaRoy115 are u still up for collab?))
@@marcus_74 yo lets do it! Whats ur discord?
If you are having problems with PLAYER MOVEMENT or PLAYER CONTROL script isn't runnig, just turn back to begin, and start over. Make sure that you put the exacly same words( include uppercase on first letter etc). I made it and work! if you miss a letter or uppercase, nothing will work!
Sorry for my bad English, i'm from Brazil!
What is the difference between the 3 action types: value, button & passthrough? And why did you choose passthrough instead of value or button? Great video, btw
If anyone is having difficulty with your movement values not resetting to 0, you need to double click the playerController Input action file, and set your movement actions Action type to be Pass Through instead of value.
Hope I helped someone save some hours on troubleshooting like I had to.
Probably saved me from that, thanks
TY I WAS GOING CRAZY XD
You are an angel among us!! Much thanks!
I just get confused with debuging movement input because my controller was connected 😭
thanks a lot for this, im a newbie so i really appreciate this video
Thank you , this video is a really good
Problem when i press play, Assets\InputManager.cs(11,12): error CS0246: The type or namespace name 'PlayerControls' could not be found (are you missing a using directive or an assembly reference?)
having the same problem here
same problem, did you find a solution?
@@wilcas5349 no sorry
I found the issue, in my case, forgot to do the step at 0:57
can someone point to me where i can learn more about whats happening at line 17 4:49? copied what's written there, but have no clue what all that really means
thanks mate
Keep it up!
Not getting input actions on right click
Have to install package first
I Love This Man!!
Why the blank screen with your picture on it starting at 6:41? I can hear you talking but there is no video.
Also, I am getting the opposite numbers you are getting with the X Y inputs.
Anybody who have trouble with not popping up "properties", go and delete "vjoy" in your computer. It collides with new Input System package.
Amazing video thanks
just starting Unity, and i think this will make my life way mor enjoyable, looking forward for this series :D
i have one question:
why do you prefer the public var over the SerialzedField Tag?
greetings
Good coding practice i.e never expose your variable to other script unless it is needed
Bro why my (PlayerMovement) error and doesNot reference from PlayerControls
You must save Asset first
Great tutorial!
Nice tutorial, checking out more of your content!
Thanks dude!
Thank youuuuuuuuuuuuuuu😍Amazing contents!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!😍
Hey man! Everything is going awesome but a small problem. The InputManager isn't appearing in the add component list. Can anyone help?
??? I am a beginner I don’t know anything about unity
having the same issues so i would like the help too
clear your search on the component list, if that doesn't work just physically drag your script from your project>assets window and drop it on your characters inspector
Happy new year sensei
Happy new year my friend :^)
Please teach us how to make a procedural climbing system
thank you soo muchh
For some reason, the camera still won't move and I followed the scripts and everything to the T. I think it might be the prefab character model I used, so I'm gonna try again with a different model to see if it helps...
bro my code showing error like this "Object reference not set to an instance of an object"what i do plss healp
Hey. In add component for the polyman there is no Input Manager showing up, even tho i programmed it and it is in the assets. can you help?
Какой же я тупой. Это пиздец. Как я собираюсь писать диплом, если даже этого понять не могу. как же все бесит
I still dont understand why are you assigning movementInput through value in OnEnable. Could anyone please fill me in?
4:51 Question : what is the expression "i => MovementInput" called. I dont know what that is and what it do.
when I double clicked on the thing it brought me to visual studios
Best Tutorial...GoOn
Could I add Left Stick as a binding rather than adding the 4 directional Left Stick input?
Hi, i write you codigo, but the character don´t move...
Great video but Im having a problem... when I go back to unity after inputting the script, it tells me this: "Assets/InputManager.cs(7,31): error CS1519: Invalid Token ';' in class, struct, or interface member declaration" If you could please help me that would mean anything, also when I try to click play it says "All compiler errors have to be fixed before you can enter play mode!"
why used analog mode ?
Thought I posted this yesterday, but it seems to be gone.. so Right with you up until 6:35 but I get a null reference, when pressing the keys, and no vector update on the player, its like I need to get the reference with getComponent in the Awake function, but YOu never did that so I assume not..
What visual studio code extensions did you use for this
hi can u make joystick movement and wasd movement
wow instant subscribe
when ever i try to open a script it brings me to unity hub
Hi.
Can you add combat bottons for a gun and sword?
and show how to use it with animations?
Can you add the script for download please?
and to all of the other videos please.
it's not working right for me.
Bruh. thank you.
Thank you for the detailed explanations on the topic of the controller, but I can not understand the reason for the errors in the code? I exactly repeat all your actions, however, the errors do not disappear, I use Unity 2021 lte. I would be grateful if you explain what is wrong. Severity Code Description Project File Line Suppression State
Error CS0119 'PlayerControl' is a type, which is not valid in the given context Assembly-CSharp, Assembly-CSharp.Player D:\UNITY_GAME\TPC_PART-2\Assets\InputManager.cs 16 Active
Error CS0120 An object reference is required for the non-static field, method, or property 'PlayerControl.Enable()' Assembly-CSharp, Assembly-CSharp.Player D:\UNITY_GAME\TPC_PART-2\Assets\InputManager.cs 23 Active
Error CS0120 An object reference is required for the non-static field, method, or property 'PlayerControl.PlayerMovement' Assembly-CSharp, Assembly-CSharp.Player D:\UNITY_GAME\TPC_PART-2\Assets\InputManager.cs 20 Active
Error CS0103 The name 'movementInput' does not exist in the current context Assembly-CSharp, Assembly-CSharp.Player D:\UNITY_GAME\TPC_PART-2\Assets\InputManager.cs 20 Active
Error CS0103 The name 'playerControlInputManager' does not exist in the current context Assembly-CSharp, Assembly-CSharp.Player D:\UNITY_GAME\TPC_PART-2\Assets\InputManager.cs 18 Active
Do you have the source codes for this series?
Problem with the read Value
When i try adding the input manager script to the low polygon character it says, "Can't add script component 'Input Manager' because the script class cannot be found. Make sure that there are no compile errors and that the file name and class name match" plz help if you can.
please help same problem
can get the 2d vector composite
Would this tutorial work with 2019.4.3f1?
Should be fine lad!
@@SebastianGraves Thankya!
What... what happened at 6:55?