Welcome to Soda Rocket Studios, an indie game dev studio that is learning along with you. Find show-cases of current projects as well as tutorials to help you make your own games.
project file is missing the most important file the player controller 😢
@Mehrdad995GTa22 күн бұрын
Exactly what I was looking for, thank you🙏
@galan2541Ай бұрын
Dude, thank you so much! Finally found the video w/o any useless explanation and just straight to the point! Subscribed 👏👏
@happyshabbygames2 ай бұрын
Thank you man. Awesome tutorial.
@phoenixcreations943 ай бұрын
The best tutorial ever, but one missimg thing sir, how can i make it from walking to running ? 😊
@sodarocketstudios3 ай бұрын
Thanks! I don't have a video on it, but what you are looking for are called blend trees. Then, you just need to multiply the speed by a sprint multiplier in the movement code.
@CreeperTheLord5 ай бұрын
what about the script?
@traynorth835 ай бұрын
how do i get the orientation box on character to its feet?
@sodarocketstudios5 ай бұрын
If you are talking about the collider, you should be able to move it around in the inspector until it matches up correctly.
@traynorth835 ай бұрын
@@sodarocketstudios No i mean the green ,red, and blue orientation box. mine is in the middle of my player.
@sodarocketstudios5 ай бұрын
The most common method is to create an empty parent object that contains the object with the player model as a child. Then, you can adjust the location of the child object with the model on it until the feet are on the ground.
@traynorth835 ай бұрын
@@sodarocketstudios thank you so much
@akael83507 ай бұрын
I have a null reference problem when I change scenes with the new input system, obviously on the onDisable(){controls.disable();} line I tried lots of things, nothing works.
@sodarocketstudios7 ай бұрын
If the error is in on disable, I would think that is caused be the initial scene that you are switching from. I don't know why the new scene would call on disable on anything unless you actively disabled it.
@sodarocketstudios7 ай бұрын
If you are still having trouble, try adding an if(controls != null) before your controls.disable line. If that fixes it, then it means that the instance of controls is being destroyed before on disable is called.
@akael83507 ай бұрын
@@sodarocketstudios the problem came from the singleton that I used to use the input script. Bug resolved.
7 ай бұрын
Thank you this helped a lot!
@stevenmarshall101311 ай бұрын
Incredible tutorial, you just earned a new subscriber!
@Rghad97 Жыл бұрын
25:59
@priceton_braswell Жыл бұрын
how can i access the generated script with another script to turn of mouselock
@sodarocketstudios Жыл бұрын
You make a variable of the same type as the generated script and use the new keyword to create an instance. i.e. GameControls controls = new GameControls. I'm away from my computer at the moment, so this will be from memory, but that should give you an instance of the input action asset. From there, you get the action map, and then whatever control you want to change. GameControls.ActionMap.MouseLook. then you can enable, disable, or just about anything else you might want to do with it.
@AmzaingCat Жыл бұрын
concise and exactly what I needed to get me started on using the input system c# class. Thanks!!
@martinrodriguez2803 Жыл бұрын
im having issues with the player controller script (not having the Move Speed*) and when i try to add the OnMove* to the Player Input/Events/Control, it doesnt pop up for me? could i have done the script wrong? im a first time use to unity so everything is new to me. Thank you in advance for the help
@sodarocketstudios Жыл бұрын
For the Move speed, do you have [SerializeField] before the vector declaration? I.e. [SerializeField] private float MoveSpeed; and for the onMove function you need to make sure you use the Public keyword so: public void OnMove. The other problem would be if the function doesn't accept a callback context. In that case you want it to look like this, OnMove(InputAction.CallbackContext context). I assumed you meant that these things weren't showing up in the inspector, which is the window in the unity editor that shows you all of the components on a selected game object. If that is the case, then it is most likely you are missing something I described above. Otherwise, I may have misunderstood your problem. If this doesn't fix your problems I can try to help you walk through it more.
@martinrodriguez2803 Жыл бұрын
@@sodarocketstudios yeah, I made sure the script matches what you provided, I wonder if it's because I'm using an updated version of unity? and yes if you are free to walk me through it would greatly appreciate it!
@sodarocketstudios Жыл бұрын
Let's start with the Move speed then, since it will probably be easier to solve. If you can give me some more detail on the problem, it will help me figure what is going on.
@martinrodriguez2803 Жыл бұрын
@@sodarocketstudios (using this code) using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.InputSystem; public class PlayerController : MonoBehaviour { [SerializeField] private float moveSpeed = 1; private Vector2 moveVector; private CharacterController characterController; // Start is called before the first frame update void Start() { characterController = GetComponent<CharacterController>(); } // Update is called once per frame void Update() { Move(); } public void OnMove(InputAction.CallbackContext context) { moveVector = context.Readvalue<Vector2>(); } private void Move() { Vector3 move = transform.right*moveVector.x + transform.forward*moveVector.y; characterController.Move(move*moveSpeed*Time.deltaTime); } }
@sodarocketstudios Жыл бұрын
That was a tricky one to catch. The error was only useful for pointing out where it was, but I believe the issue is that you didn't capitalize the v in ReadValue in your OnMove function.
@sadevkalubowila3167 Жыл бұрын
Hello @Soda Rocket Studios. Thanks for the great tutorial. I'm also trying to customize the appearance of the slider. I used a sprite for the filling area that has curve ends. I just wanted to keep the shape through out all the filling percentages. I followed your tutorial and setted the boundaries of the sprite as you said. Tried all four options (simple, sliced, tiled, filled). But unfortunately ends of the filling area get distorted when slider animating. Can you give me any hint for sort this out. I already spent more than enough hours. :( Much appreciated for any suggestions. Thnkx
@sodarocketstudios Жыл бұрын
Starting with the import settings of your sprite (the inspector window you get when selecting the asset from your assets folder), you will want to make sure the mesh type is set to full rect. Then open the sprite editor and drag the green bounds into place. Everything inside the bounds is tiled to fill the space. The top and bottom are tiled horizontally, and the sides are tiled vertically. The corners will not be changed. In the sprite renderer for the fill area of your slider, you will want to select sliced under the draw mode. This page may help. docs.unity3d.com/Manual/9SliceSprites.html
@otherdev8255 Жыл бұрын
Two years ago!! this should have showed up the 8th time i looked up input tutorials
@AryanRekhi Жыл бұрын
Can you please continue this tutorial to add a shift sprint and make this bit smooth
@sodarocketstudios Жыл бұрын
To add sprinting, you just need to change the movement speed when the sprint key is pressed.
@AryanRekhi Жыл бұрын
@@sodarocketstudios what if statement where do a GetKeyDown press shift = increase the speed of the player and play the sprinting animation Will that work?
@sodarocketstudios Жыл бұрын
With how I setup the control script, I think the easiest way would be to add in a sprint input action. Then in the player controller script add an OnSprint function just like all of the other controls. In that function you will want to check the phase of the sprint button. If the phase is started(meaning the button was pressed) you can multiply the movement speed by some sprint speed multiplier. If the phase is canceled (meaning the button was released) you can then divide my that speed multiplier. So you will have: If(context.started) MovementSpeed*=sprintMultiplier If(context.canceled) MovementSpeed/=sprintMultiplier
@AryanRekhi Жыл бұрын
@@sodarocketstudios is it possible that I can share my updated script with you on Twitter or something so that you can look into it , and if you can also tell me what could I change in animator window with sprint animation
@sodarocketstudios Жыл бұрын
On Twitter I am @SodaRocketDev. Or if you go to my channel, you can get my email (I don't want to put it in a comment to avoid bots). As for the animation part, I haven't done too much with animations so I can't tell you exactly what to do, but I can point you toward blend trees. I know there are several tutorials on them, and I think that might be what you are looking for.
@manfredjohannes2771 Жыл бұрын
love it
@petethechin Жыл бұрын
Very Very helpful, TYVM
@danishsaeed7969 Жыл бұрын
Jump is not working after I pressed Space button it didn't work??
@sodarocketstudios Жыл бұрын
The easiest way to fix it is to walk through each part and check it. I would start by making sure your input action is set up correctly. Then make sure you have connected the jump method to the jump action on the player input manager. If both of those are correct, then it is likely something wrong with the jump function. If it is a problem with code, I will need to know more to help.
@danishsaeed7969 Жыл бұрын
@@sodarocketstudios Thanks of the reply, but I have corrected it on the moment 😊
@danishsaeed7969 Жыл бұрын
Hi, I didn't find that Input Actions?? Can anyone help me??
@ellavonck7045 ай бұрын
i know its a bit late but you need to install the input system package, package manager -> unity registry -> input system
@albertskavish2808 Жыл бұрын
Hello. Do you do private lessons, online? I need some help with the input system. Soda is on me!
@sodarocketstudios Жыл бұрын
I don't currently, but I'm sure we could figure something out.
@sodarocketstudios Жыл бұрын
Send me an email and we can talk more. You can get my email address from the about section on my channel.
@vinnaweng Жыл бұрын
Great tutorial, but jump seems not working. When I clicked on play, the character just kept flying and disappeared.
@sodarocketstudios Жыл бұрын
I'm guessing you got a sign wrong somewhere, make sure the gravity is applying a negative y to the velocity. I changed my mind on where I put the negative sign in the video, so I wouldn't be surprised if you set gravity as negative and then in the on move you have another negative sign canceling it out.
@vinnaweng Жыл бұрын
@@sodarocketstudios Thanks. I fixed the gravity sign. Your code works great! I added a mesh collider to the 3D scene, then the character won't keep falling out of the scene. :D
@johnpotesta3744 Жыл бұрын
Thank you
@darkmath100 Жыл бұрын
How much harder is this in the new UI Toolkit?
@sodarocketstudios Жыл бұрын
I'm not sure. I will have to look into it to see what might be different.
@sodarocketstudios Жыл бұрын
I wouldn't think it would be any more difficult since you just need to swap out the sprites.
@darkmath100 Жыл бұрын
@@sodarocketstudios I just tried it and it's arguably harder in the new UI Toolkit. For every step forward there was one step back.
@sodarocketstudios Жыл бұрын
I can look into it some more. I've not messed with the UI Toolkit, so I'm not sure what changes.
@sodarocketstudios Жыл бұрын
I started looking a little bit last night to get an idea of how the Toolkit works. I think I will have to set up a project to play with it a little.
@wrightexe1 Жыл бұрын
I've had vague thoughts about making a game, probably something simple like Iron Lung. Thanks for the tips, I'll definitely revisit this video if and when I get a concrete concept.
@sodarocketstudios Жыл бұрын
I definitely recommend the book. It has really helped me with planning out my current game. Also look into making a game design document. It doesn't have to be complicated, just enough to get your idea written out more formally.
@chuck3557 Жыл бұрын
𝔭𝔯𝔬𝔪𝔬𝔰𝔪 👉
@gabo-7 Жыл бұрын
Great tutorial, just what I needed!
@waffleman45032 жыл бұрын
greatest video ive seen in my entire life
@sodarocketstudios Жыл бұрын
Well thank you, I'm glad you liked it.
@luckyrider12 жыл бұрын
super
@sodarocketstudios2 жыл бұрын
Thanks
@ZenitsuKunn2 жыл бұрын
Can i play
@sodarocketstudios2 жыл бұрын
My game is available on itch.io.
@hermanmunster46072 жыл бұрын
fantastic, thank you
@sodarocketstudios2 жыл бұрын
Glad you liked it!
@BenGodot2 жыл бұрын
how would you do this for first person?
@sodarocketstudios2 жыл бұрын
The easiest way would be to create an empty game object under the character hierarchy. You will put this object where you want the eyes to be. then set the camera (Not a cinemachine virtual camera) as a child of the eyes object and set the position as (0,0,0).
@BenGodot2 жыл бұрын
@@sodarocketstudios thank you!
@BenGodot2 жыл бұрын
@@sodarocketstudios this works great, but the player starts to randomly move around unless you move forward and I'm not sure how to make it so you can look left and right
@sodarocketstudios2 жыл бұрын
@@BenGodot When you say it randomly moves, is it just walking on its own, or more like sliding? If it is walking around, then the only problem I can think of is that the motion vector isn't getting zeroed properly when you release the movement buttons. Looking left and right should be handled with the rotate method we created that will rotate the character around the y-axis. I am realizing now, that if you converted this controller to first person, then you wouldn't be able to look up and down, so you would need to add that by rotating the camera around its local x-axis based on the y value from the mouse delta. If you set it up to look up and down, but not left and right, then you want to rotate the character on the y-axis using the x component of the delta, and rotate the camera on its x-axis based on the y component of the mouse delta.
@BenGodot2 жыл бұрын
@@sodarocketstudios thank you!
@samsg15382 жыл бұрын
isnt working no clue what i did wrong
@samsg15382 жыл бұрын
followed all steps character wont move
@sodarocketstudios2 жыл бұрын
What part isn't working? It's possible that I had a mistake in the video, or something changed between different versions of unity. You aren't the only that seems to be having problems, so it might help others if we can work through it.
@samsg15382 жыл бұрын
@@sodarocketstudios im on unity 2021 so maybe thats why but i found a third person controller pack in the unity asset store so im using that now
@hugosouza19932 жыл бұрын
Thanks a lot man!
@sodarocketstudios2 жыл бұрын
No problem.
@GinesLA2 жыл бұрын
jump dont works for me
@sodarocketstudios2 жыл бұрын
In what way does it not work? I can try to walk through it with you.
@Xyz123912 жыл бұрын
Nice! Thanks
@sodarocketstudios2 жыл бұрын
No problem.
@allthings57572 жыл бұрын
Congratulations on winning gane jam of 2022 made by brackeys
@Me-xg2rt2 жыл бұрын
He didnt say he won
@allthings57572 жыл бұрын
@@Me-xg2rt I an him that you ave won brackyes game jam of 2022
@Skeffles2 жыл бұрын
Excellent video! This is solid advice.
@daanishay33822 жыл бұрын
can you give the project please
@sodarocketstudios2 жыл бұрын
I added a link to the description.
@taimoori2 жыл бұрын
Amazing work and movement system setup. I was searching for this for months. Thanks ❤️
@sodarocketstudios2 жыл бұрын
Glad it helped!
@elonmusk48232 жыл бұрын
pls put it in dicreption
@elonmusk48232 жыл бұрын
can i have that script it is hard to type pls
@sodarocketstudios2 жыл бұрын
I will put it up when I get a chance. Unfortunately I won't have access to the computer with the files for awhile.
@zoesidener77242 жыл бұрын
Thanks for this! I'll need to go back through my game and fix some things to fit SOLID, but it's best to catch it earlier than later so issues can be fixed without as much hassle in the future
@sodarocketstudios2 жыл бұрын
It is definitely a process to get it there, but it is worth it in the end when you have a strong foundation to your game that makes it easier to add anything you can think of.
@Skeffles2 жыл бұрын
Excellent to finally see a video explaining these in a game development context!
@sodarocketstudios2 жыл бұрын
Thanks! I noticed there were a lot of videos explaining them, but I just felt like a lot of them were just missing something to really show how to use them.
@Skeffles2 жыл бұрын
@@sodarocketstudios sometimes having a specific example helps. I went to a talk were the speaker used the death star from star wars as his example.
@dadsspaghetti97742 жыл бұрын
Hey man i know this is a dumb question but for some reason i cant find the onmove in the player input
@sodarocketstudios2 жыл бұрын
It's a function that you have to create before you can connect it to the input system. If you did make it, then make sure it is public. If you don't specify it is set to private by default and you won't be able to see it.
@watercat12482 жыл бұрын
I trying to learn how new input system works now and this video is use full however I don't understand how the axis the works i need to understand how the buttons the have more 2 value works
@sodarocketstudios2 жыл бұрын
The axis is just an analog (float) value, which means instead of being either on or off (pressed or released), It can be any value. Usually an axis is in the range of -1 to 1 or 0 to 1. Think about a trigger on a controller. If you don't press it down, it will return a value of 0. If you hold it down all the way, you will get one. But, what if you want to use the trigger as a throttle for a car. Then you probably want to be able to give partial throttle like 50% (the value would be 0.5). that's when you would treat the trigger as an axis. You can also think about the left and right movement of a joystick. In this case, the value from the input would be a float between -1 and 1. If you put the stick all the way to le left, you get -1. If it is all the way to the right, you get 1. 0 is when the stick is right in the middle, but you can also get decimal values if the stick is somewhere between the middle and either side. This can let you move a character at varying speed based on how far the stick is from the center. I hope that explains what you were asking about. Thanks for the comment.
@watercat12482 жыл бұрын
@@sodarocketstudios i know that aixs have range of range of -1 to 1 and all the intermediates i have already know how to make work in old input system i just don't know how to make work with the actions and even system find un example that am able to understand basically i need i code example that explains how the value system works in the new input system
@sodarocketstudios2 жыл бұрын
You can treat it just like a button by subscribing some handler function to the onPerformed event. The main difference is that you usually want access to the value. To do that you will use .ReadValue() on the callback context you are sending to the handler. Another option is to just call ReadValue() input action itself inside the update method. For that you will need a reference to the input action asset. I have a second input system video that explains how to use the generate c# script option that has an example of the second option. My character control videos may explain how to do it the other way, but I don't remember exactly how I did it in those videos.
@watercat12482 жыл бұрын
@@sodarocketstudios ok i will take look
@DsiakMondala2 жыл бұрын
based
@sulfurasmr63652 жыл бұрын
wow, thank you. I've been looking through the documentation by myself and it's really nice to have someone explain it to fill the gaps
@sodarocketstudios2 жыл бұрын
You're welcome. The documentation really helps, but there is definitely some important information missing.
@princekogaianmikoshi4052 жыл бұрын
In the input control's where you made the jump function If I add in another a 3rd button F for Fly what button on a controller would you make it I was thinking L3 or so R3 can be dash or run
@sodarocketstudios2 жыл бұрын
You can use any button you want. Personally, I like the idea of reusing the jump button and in the OnJump method add, if (isGrounded) then jump else fly.
Пікірлер
project file is missing the most important file the player controller 😢
Exactly what I was looking for, thank you🙏
Dude, thank you so much! Finally found the video w/o any useless explanation and just straight to the point! Subscribed 👏👏
Thank you man. Awesome tutorial.
The best tutorial ever, but one missimg thing sir, how can i make it from walking to running ? 😊
Thanks! I don't have a video on it, but what you are looking for are called blend trees. Then, you just need to multiply the speed by a sprint multiplier in the movement code.
what about the script?
how do i get the orientation box on character to its feet?
If you are talking about the collider, you should be able to move it around in the inspector until it matches up correctly.
@@sodarocketstudios No i mean the green ,red, and blue orientation box. mine is in the middle of my player.
The most common method is to create an empty parent object that contains the object with the player model as a child. Then, you can adjust the location of the child object with the model on it until the feet are on the ground.
@@sodarocketstudios thank you so much
I have a null reference problem when I change scenes with the new input system, obviously on the onDisable(){controls.disable();} line I tried lots of things, nothing works.
If the error is in on disable, I would think that is caused be the initial scene that you are switching from. I don't know why the new scene would call on disable on anything unless you actively disabled it.
If you are still having trouble, try adding an if(controls != null) before your controls.disable line. If that fixes it, then it means that the instance of controls is being destroyed before on disable is called.
@@sodarocketstudios the problem came from the singleton that I used to use the input script. Bug resolved.
Thank you this helped a lot!
Incredible tutorial, you just earned a new subscriber!
25:59
how can i access the generated script with another script to turn of mouselock
You make a variable of the same type as the generated script and use the new keyword to create an instance. i.e. GameControls controls = new GameControls. I'm away from my computer at the moment, so this will be from memory, but that should give you an instance of the input action asset. From there, you get the action map, and then whatever control you want to change. GameControls.ActionMap.MouseLook. then you can enable, disable, or just about anything else you might want to do with it.
concise and exactly what I needed to get me started on using the input system c# class. Thanks!!
im having issues with the player controller script (not having the Move Speed*) and when i try to add the OnMove* to the Player Input/Events/Control, it doesnt pop up for me? could i have done the script wrong? im a first time use to unity so everything is new to me. Thank you in advance for the help
For the Move speed, do you have [SerializeField] before the vector declaration? I.e. [SerializeField] private float MoveSpeed; and for the onMove function you need to make sure you use the Public keyword so: public void OnMove. The other problem would be if the function doesn't accept a callback context. In that case you want it to look like this, OnMove(InputAction.CallbackContext context). I assumed you meant that these things weren't showing up in the inspector, which is the window in the unity editor that shows you all of the components on a selected game object. If that is the case, then it is most likely you are missing something I described above. Otherwise, I may have misunderstood your problem. If this doesn't fix your problems I can try to help you walk through it more.
@@sodarocketstudios yeah, I made sure the script matches what you provided, I wonder if it's because I'm using an updated version of unity? and yes if you are free to walk me through it would greatly appreciate it!
Let's start with the Move speed then, since it will probably be easier to solve. If you can give me some more detail on the problem, it will help me figure what is going on.
@@sodarocketstudios (using this code) using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.InputSystem; public class PlayerController : MonoBehaviour { [SerializeField] private float moveSpeed = 1; private Vector2 moveVector; private CharacterController characterController; // Start is called before the first frame update void Start() { characterController = GetComponent<CharacterController>(); } // Update is called once per frame void Update() { Move(); } public void OnMove(InputAction.CallbackContext context) { moveVector = context.Readvalue<Vector2>(); } private void Move() { Vector3 move = transform.right*moveVector.x + transform.forward*moveVector.y; characterController.Move(move*moveSpeed*Time.deltaTime); } }
That was a tricky one to catch. The error was only useful for pointing out where it was, but I believe the issue is that you didn't capitalize the v in ReadValue in your OnMove function.
Hello @Soda Rocket Studios. Thanks for the great tutorial. I'm also trying to customize the appearance of the slider. I used a sprite for the filling area that has curve ends. I just wanted to keep the shape through out all the filling percentages. I followed your tutorial and setted the boundaries of the sprite as you said. Tried all four options (simple, sliced, tiled, filled). But unfortunately ends of the filling area get distorted when slider animating. Can you give me any hint for sort this out. I already spent more than enough hours. :( Much appreciated for any suggestions. Thnkx
Starting with the import settings of your sprite (the inspector window you get when selecting the asset from your assets folder), you will want to make sure the mesh type is set to full rect. Then open the sprite editor and drag the green bounds into place. Everything inside the bounds is tiled to fill the space. The top and bottom are tiled horizontally, and the sides are tiled vertically. The corners will not be changed. In the sprite renderer for the fill area of your slider, you will want to select sliced under the draw mode. This page may help. docs.unity3d.com/Manual/9SliceSprites.html
Two years ago!! this should have showed up the 8th time i looked up input tutorials
Can you please continue this tutorial to add a shift sprint and make this bit smooth
To add sprinting, you just need to change the movement speed when the sprint key is pressed.
@@sodarocketstudios what if statement where do a GetKeyDown press shift = increase the speed of the player and play the sprinting animation Will that work?
With how I setup the control script, I think the easiest way would be to add in a sprint input action. Then in the player controller script add an OnSprint function just like all of the other controls. In that function you will want to check the phase of the sprint button. If the phase is started(meaning the button was pressed) you can multiply the movement speed by some sprint speed multiplier. If the phase is canceled (meaning the button was released) you can then divide my that speed multiplier. So you will have: If(context.started) MovementSpeed*=sprintMultiplier If(context.canceled) MovementSpeed/=sprintMultiplier
@@sodarocketstudios is it possible that I can share my updated script with you on Twitter or something so that you can look into it , and if you can also tell me what could I change in animator window with sprint animation
On Twitter I am @SodaRocketDev. Or if you go to my channel, you can get my email (I don't want to put it in a comment to avoid bots). As for the animation part, I haven't done too much with animations so I can't tell you exactly what to do, but I can point you toward blend trees. I know there are several tutorials on them, and I think that might be what you are looking for.
love it
Very Very helpful, TYVM
Jump is not working after I pressed Space button it didn't work??
The easiest way to fix it is to walk through each part and check it. I would start by making sure your input action is set up correctly. Then make sure you have connected the jump method to the jump action on the player input manager. If both of those are correct, then it is likely something wrong with the jump function. If it is a problem with code, I will need to know more to help.
@@sodarocketstudios Thanks of the reply, but I have corrected it on the moment 😊
Hi, I didn't find that Input Actions?? Can anyone help me??
i know its a bit late but you need to install the input system package, package manager -> unity registry -> input system
Hello. Do you do private lessons, online? I need some help with the input system. Soda is on me!
I don't currently, but I'm sure we could figure something out.
Send me an email and we can talk more. You can get my email address from the about section on my channel.
Great tutorial, but jump seems not working. When I clicked on play, the character just kept flying and disappeared.
I'm guessing you got a sign wrong somewhere, make sure the gravity is applying a negative y to the velocity. I changed my mind on where I put the negative sign in the video, so I wouldn't be surprised if you set gravity as negative and then in the on move you have another negative sign canceling it out.
@@sodarocketstudios Thanks. I fixed the gravity sign. Your code works great! I added a mesh collider to the 3D scene, then the character won't keep falling out of the scene. :D
Thank you
How much harder is this in the new UI Toolkit?
I'm not sure. I will have to look into it to see what might be different.
I wouldn't think it would be any more difficult since you just need to swap out the sprites.
@@sodarocketstudios I just tried it and it's arguably harder in the new UI Toolkit. For every step forward there was one step back.
I can look into it some more. I've not messed with the UI Toolkit, so I'm not sure what changes.
I started looking a little bit last night to get an idea of how the Toolkit works. I think I will have to set up a project to play with it a little.
I've had vague thoughts about making a game, probably something simple like Iron Lung. Thanks for the tips, I'll definitely revisit this video if and when I get a concrete concept.
I definitely recommend the book. It has really helped me with planning out my current game. Also look into making a game design document. It doesn't have to be complicated, just enough to get your idea written out more formally.
𝔭𝔯𝔬𝔪𝔬𝔰𝔪 👉
Great tutorial, just what I needed!
greatest video ive seen in my entire life
Well thank you, I'm glad you liked it.
super
Thanks
Can i play
My game is available on itch.io.
fantastic, thank you
Glad you liked it!
how would you do this for first person?
The easiest way would be to create an empty game object under the character hierarchy. You will put this object where you want the eyes to be. then set the camera (Not a cinemachine virtual camera) as a child of the eyes object and set the position as (0,0,0).
@@sodarocketstudios thank you!
@@sodarocketstudios this works great, but the player starts to randomly move around unless you move forward and I'm not sure how to make it so you can look left and right
@@BenGodot When you say it randomly moves, is it just walking on its own, or more like sliding? If it is walking around, then the only problem I can think of is that the motion vector isn't getting zeroed properly when you release the movement buttons. Looking left and right should be handled with the rotate method we created that will rotate the character around the y-axis. I am realizing now, that if you converted this controller to first person, then you wouldn't be able to look up and down, so you would need to add that by rotating the camera around its local x-axis based on the y value from the mouse delta. If you set it up to look up and down, but not left and right, then you want to rotate the character on the y-axis using the x component of the delta, and rotate the camera on its x-axis based on the y component of the mouse delta.
@@sodarocketstudios thank you!
isnt working no clue what i did wrong
followed all steps character wont move
What part isn't working? It's possible that I had a mistake in the video, or something changed between different versions of unity. You aren't the only that seems to be having problems, so it might help others if we can work through it.
@@sodarocketstudios im on unity 2021 so maybe thats why but i found a third person controller pack in the unity asset store so im using that now
Thanks a lot man!
No problem.
jump dont works for me
In what way does it not work? I can try to walk through it with you.
Nice! Thanks
No problem.
Congratulations on winning gane jam of 2022 made by brackeys
He didnt say he won
@@Me-xg2rt I an him that you ave won brackyes game jam of 2022
Excellent video! This is solid advice.
can you give the project please
I added a link to the description.
Amazing work and movement system setup. I was searching for this for months. Thanks ❤️
Glad it helped!
pls put it in dicreption
can i have that script it is hard to type pls
I will put it up when I get a chance. Unfortunately I won't have access to the computer with the files for awhile.
Thanks for this! I'll need to go back through my game and fix some things to fit SOLID, but it's best to catch it earlier than later so issues can be fixed without as much hassle in the future
It is definitely a process to get it there, but it is worth it in the end when you have a strong foundation to your game that makes it easier to add anything you can think of.
Excellent to finally see a video explaining these in a game development context!
Thanks! I noticed there were a lot of videos explaining them, but I just felt like a lot of them were just missing something to really show how to use them.
@@sodarocketstudios sometimes having a specific example helps. I went to a talk were the speaker used the death star from star wars as his example.
Hey man i know this is a dumb question but for some reason i cant find the onmove in the player input
It's a function that you have to create before you can connect it to the input system. If you did make it, then make sure it is public. If you don't specify it is set to private by default and you won't be able to see it.
I trying to learn how new input system works now and this video is use full however I don't understand how the axis the works i need to understand how the buttons the have more 2 value works
The axis is just an analog (float) value, which means instead of being either on or off (pressed or released), It can be any value. Usually an axis is in the range of -1 to 1 or 0 to 1. Think about a trigger on a controller. If you don't press it down, it will return a value of 0. If you hold it down all the way, you will get one. But, what if you want to use the trigger as a throttle for a car. Then you probably want to be able to give partial throttle like 50% (the value would be 0.5). that's when you would treat the trigger as an axis. You can also think about the left and right movement of a joystick. In this case, the value from the input would be a float between -1 and 1. If you put the stick all the way to le left, you get -1. If it is all the way to the right, you get 1. 0 is when the stick is right in the middle, but you can also get decimal values if the stick is somewhere between the middle and either side. This can let you move a character at varying speed based on how far the stick is from the center. I hope that explains what you were asking about. Thanks for the comment.
@@sodarocketstudios i know that aixs have range of range of -1 to 1 and all the intermediates i have already know how to make work in old input system i just don't know how to make work with the actions and even system find un example that am able to understand basically i need i code example that explains how the value system works in the new input system
You can treat it just like a button by subscribing some handler function to the onPerformed event. The main difference is that you usually want access to the value. To do that you will use .ReadValue() on the callback context you are sending to the handler. Another option is to just call ReadValue() input action itself inside the update method. For that you will need a reference to the input action asset. I have a second input system video that explains how to use the generate c# script option that has an example of the second option. My character control videos may explain how to do it the other way, but I don't remember exactly how I did it in those videos.
@@sodarocketstudios ok i will take look
based
wow, thank you. I've been looking through the documentation by myself and it's really nice to have someone explain it to fill the gaps
You're welcome. The documentation really helps, but there is definitely some important information missing.
In the input control's where you made the jump function If I add in another a 3rd button F for Fly what button on a controller would you make it I was thinking L3 or so R3 can be dash or run
You can use any button you want. Personally, I like the idea of reusing the jump button and in the OnJump method add, if (isGrounded) then jump else fly.