I know im asking randomly but does any of you know of a method to get back into an Instagram account?? I was dumb lost my password. I appreciate any help you can offer me!
@Jayce Jake I really appreciate your reply. I found the site through google and im waiting for the hacking stuff atm. Seems to take quite some time so I will reply here later when my account password hopefully is recovered.
@Ahmed Elnaeim his scripts are good enough ( When he actually teaches how to make them from scratch ) , but they're extremely simplified which is great, but in the long run, they really aren't that optimized, I guess that's a conscious choice to avoid overwhelming beginners with some intermediate stuff.
So much better than all the other 2D PlayerController tutorials I've seen. It's refreshing to see a RUclipsr actually create the controller from scratch, as opposed to recommending a 3rd party script. Please do more game programming tutorials!
Thanks Timothy, you hit the nail on the head with the 3rd party stuff. I have some full game making tutorials planned. Unity is in a transition phase with their Input system which has made making tutorials a problem, as they will all break the moment the new system rolls out. But I'm putting some stuff together. Make sure to sub, and visit the discord to hang out with me and talk gamedev :)
@Susuya Juuzou i don't know I think that brackeys is just more focused on beginners who don't want to code hard code (EG. LINECASTS) BUT i DO THINK THAT SOME of his tuts are pretty good and usefull (eg. cinamachine tutorial). Another really good channel is blackthornprod but his tut on movement didn't help me as much as this one for my game.You just need to find out which channel is best suited for you as the learner
Scripting starts at 18:40 (The intro is pretty basic). Really appreciate that you didn't ask us to download a premade character controller like the other tutorials did (I hardly learnt nothing with them)
Hey Everyone. Just in case anyone has problems with the jump after they make the ground check, make sure the GO you are using is below the feet level of whatever char you are using. Decided to share this knowledge, after I struggled with it for two days :D
Haha! Thanks for the high praise! It really means a lot. Make sure to check out my latest video and see if I'm on the right track. Will mix it up between that classroom style and this in depth tutorial format.
The coding tutorial part is awesome. Shows what does what really clearly and simply even for those who have no clue about C#, Unity or OOP altogether, such as myself.
If anyone else missed it at 6:10. If you are missing the SAMPLES part in the animation window, just press the gear on the right side of the tab, and click show sample rate!
this is a great tutorial. almost every other teacher out there skips important steps and clicks around too fast without explaining all the details of what is going on. So far this is the best. I will be watching more. thanks
If some people are still having trouble with the ground check, you can just use a collider and us void OnColliderEnter2D(Collision collision) { if(collision.collider.tag == "Ground"){ isGrounded = true; } } and vise-versa
This video came a day before my birthday a year ago and now the only think I can think of is I could have started that day... but man, without you I don't think I could have started off with the right foot now, I just reconciled with making videogames thanks to you.
I've only watched a few tutorials of yours, but you are by far the best teacher of Unity I've come across. You go over details and explain in a way that non-technical gurus can understand. I"m so excited to watch all of your vids. Subscribed!
Hey, I know this is a little late but I thought it might be worth noting that it is better to receive inputs in the update method and then call what we want it to do when we hit the key in the fixed update as otherwise we can "miss" inputs from the player, but we also wouldn't want to have everything in update for the reasons you already explained in that it is a physics-based game. keep up the good work with your videos :)
@@kirbotherapto2255 it looks like visual studio 2017 and likely community version, though if you are new just use whatever is a stable release 2017 still fine but 2019s one seems to be fine by now
What if the character is still jumping in the air? I mean it's jumping on the ground but also whenever it is close to the ground, but not actually "touching" it, I wrote all of the code that you wrote and also added the 3 ground checkers, what could be the problem there?
Nvm, this could be kinda douchbagy but I'm gonna recommend another RUclipsr's video for doing good jumps if you're having trouble with this method ruclips.net/video/QGDeafTx5ug/видео.html&t
you're a genius, dude I have been watching Unity tutorials for like 2 years now and you are the best guy doing it I swear to god, your videos are better than some I paid for, thank you
The problem with ur code is that u also could jump without touching the ground eg. hitting a celling while jumping. Its just safer doing it with a groundcheck
Or set up something like a bool for isjumping, if(rb2d.velocity.y < 0 || rb2d.velocity.y > 0) { isjumping = true; }, then on the if for the Input.GetKey add && !isjumping
Thank you so much for this video. One of the few tutorials I could find where the guy actually takes his time to explain most of the stuff he does instead of just speedrunning it
You want to make sure that your GroundCheck empty is slightly below the bottom of your BoxCollider2D, otherwise it'll never actually be touching the ground
Use this: public bool isgrounded; void OnCollisonEnter2D(Collider 2D collison){ if(collison.gameObject.CompareTag("Ground"){//insert Ground tag to platfrom isgrounded = true; } } //this will check make isgrounded true when touches the ground void OnCollisonExit2D{ if(collision. gameObject.CompareTag("Ground"){ isgrounded = false; } } //will not allow player to jump infinite void OnCollisionStay2D(collider2d collison){ isgrounded = true; } } //it will allow player to jump if between two platform Then insert isgrounded boolean to jump input
Instead of all Ground layers and groundCheck gameobject & layermask etc..just write this code for jumping section: if (Input.GetKey("space") && Mathf.Abs(rb2d.velocity.y)< 0.001f) { rb2d.velocity = new Vector2(rb2d.velocity.x, jumpForce); animator.Play("Player_jump"); } // jumpForce just a float variable I used.
All I wanted was a tutorial that showed me how to get my animations and graphics on screen and moving/jumping, that's it. After a few days of searching I come across this absolute gem of a tutorial. THANK YOU.
Hmm, I keep getting a warning return as : Assets/Scripts/PlayerControllerV2.cs(14,15): warning CS0649: Field 'PlayerControllerV2.groundCheck' is never assigned to, and will always have its default value null So, it thinks my Transform groundCheck isn't referencing anything?
Serialized Private fields, like groundCheck in this code, will always give this warning as you assign the value in the inspector, not in the code, so the code doesn't know it has already been assigned. Feel free to completely ignore this.
Or just ignore it.... It's not an actual error it is just your Script not being smart enough to read that you assigned it in the Inspector. It isn't gonna realize all of a sudden that the value was assigned since you didn't specify specifically in the script. Code is incredibly overly specific because it is translating into 0 and 1 for the computer to process. The computer itself can't read text it has no idea what anything you write means, it's the Code Editor itself that turns your words into binary for the computer.
I'm almost mad how helpful this was. you're telling me I spend 4 hours trying to code it correctly and did it all over again without fail in less than an hour.....auwch. amazing tutorial thanks.
This is incredibly useful, one to bookmark for sure. I always have problems getting 2D characters set up just right, but this video really points me in the right direction.
Man, I love Brackeys, but this is the best tutorial if you want to fully understand how to create the basics of player movement script. Well done, Lost Relic!
Hey mate, my first tutorial actually so a little sloppy in places, with some bad habits I picked up from other material, which I've since corrected for newer video. I really appreciate the comment mate, It helps a lot! :)
Thank you very much for you, I finally found a very good tutorial and added to my knowledge. I hope you get a reward for your kindness to teach all of this. I'm waiting for the next lesson
Been looking for a tutorial on this for so long by far the best one I have came across. Thanks for the help :D Will be watching much more of your videos
Thank you! Awesome tutorial! Did you [SerializeField] for groundcheckL & R? I don't get how those fields appeared in your Player inspector. I had to add variables similar to the Transform groundCheck we created earlier in order to get it working.
@@belebs runSpeed needs to be a public float instead of a private. public float runSpeed; If you leave it as a private float you need to use [SerializeField] [SerializeField] private float runSpeed;
This seems like a really great tutorial! Ive set Up some 2D controllers before but its always useful to watch other people do it! I Hope you make more tutorials in the future :D
Ha thanks Thomas! That's the thing with Unity, there are so many approaches to typical tasks like this. I remember trying many when i was first starting. I Appreciate the comment!
Fantastic. I actually wanted to learn HOW to program a basic 2D character controller, not just download a pre-made one and run it. This helps out a lot when it comes to getting started with that. Thanks so much for the information.
PLS HELP!! Assets\Scripts\PlayerController2D.cs(14,15): warning CS0649: Field 'PlayerController2D.groundCheck' is never assigned to, and will always have its default value null Even Though i dragged The GroundCheck Empty to a link, checked if there are some mistakes in the script.. Everything is fine, but still the same mistake Cant fix it for hours! pls help((
Best tutorial I have ever used. Everything on the tutorial was presented in Unity correctly. I am squealing like a little girl seeing my ogre dude walk.
I started looking into unity as of recently and I was really looking for a video like this, that lets me actually understand the coding behind the character controller itself. The linecast was a really nice addition to learn, and everything was so simple and on point that even my dumbass could understand. Every person starting in unity needs to watch this. Subbed
Thanks so much for your feedback! I'll continue refining the teaching process further - talking through ideas and decisions, not just blindly typing them like man do. Welcome to the channel! Here's an invite to the discord if you ever need to discuss the tutorials or game dev in general: discord.gg/yeTuU53
My dude I love this, yea brackeys seems like hes had a hard time keeping up with new changes, he is more about marketing new features. You have arrived at an opportune time in my opinion. Loved the video and it helped me really get my game started.
Hey thanks man, I really appreciate it ay. And I do agree that most channels are glossing over the details. Glad you enjoy the format! All the best on your game dev journey.
Best Unity tutorial so far! Can you do more tutorials please? Like shooting, grabbing, inventory system, game menu, game over, settings tab, skills tab etc...
My chatacter plays all the animation at the same time.. like when i jump it plays both idel and jump animation, and if i press a or d while jumping it plays three animation at the same time,m
what i used to do the ground check was: if (rgb2d.IsTouchingLayers(LayerMask.GetMask("ground"))){} dont know if it have bugs later on, but i find it easier to understand. :D
Great video! I'm making a Mega Man Zero style game and this helped me understand how to manipulate the PlayerController somewhat to replicate the feel of specifically Mega Man Zero 3, which I'm playing at the moment.
I've followed your instructions as close as possible but I keep running into "Warning CS0649 Field 'PlayerController2d.groundCheck' is never assigned to, and will always have its default value null Assembly-CSharp" Please help me!
Thank you so much for this tutorial! It really helped me to understand a lot of the concepts. The only thing im not totally getting is the jumping, is there any way you could do a more in depth tutorial on it? Maybe making a whole jumping system for like a double jump or something. Either way love what you're doing and cant wait to go through your other tutorials!
I did the part of the ground check, and I got all the programming alright too (I've checked it twice). When I press the jump button nothing happens, as the ground check thinks I'm not grounded. Someone can help?
Oh man I've been awaken for whole night , I tried grasping basics of unity , now I'll work on C# for few hrs as I've already some experience in OOP from C++, I don't think C# will be a trouble
"Assets\Scripts\PlayerController.cs(15,15): warning CS0649: Field 'PlayerController.groundCheck' is never assigned to, and will always have its default value null" it is assigned, did someone have a similar problem and got the answer? btw amazing tutorial
@@lexonbee I'm having this issue aswell, right now :s Did you fix this in the meantime perhaps? i was ok up untill that groundcheck. gdmn groundchecks..
Great tutorial, helped me a lot! I have a question though, so I would really appreciate if someone out there could help me out. So when you jump from the ground under a low platform, sometimes it jumps immediately after the grounchecks meet the platform; which i think is not a great player experience in my project. (Check 43:53 to see a visual example of it) I want my character to land first, then jump. How can I avoid the immediate jump to happen? Thanks in advance!!!
You can make a cooldown to jump after landing. Add the "wasJumping" (false by default) variable, which becomes true after the jump start. While it is true, the character cannot jump again. Then add to the successful ground check the "wasJumping" variable check and if it is true, then turn on the independent cooldown and at the end make "wasJumping" false. I have not tested this in practice. :)
At 22:14, why are you checking for input in FixedUpdate? Isn't that against the Unity recommendations? As far as I understand checking for input in FixedUpdate may cause your key strokes not to be recognized sometimes.
Hi at around 42:40 you can see that the player gets stuck on the side of a wall when pressing the run into it, this is happening in my project as well. Unfortunately the solution only works if you want to make a one way platform rather than a platform the player can not jump through. How would you prevent the player from getting stuck on the side of a platform that they cannot jump through?
@@LostRelicGames Hey man!! I had lil trouble. Well My tile isn't one so i have put it on GameObject called Tiles!! Now here is the problem..when i tries to jump the play it won't buzz a inch!! Well my character left , right movement is work when i play ------------------------------------ c0de ---------------------------------- if(Physic2D.Linecast(transform.position, GroundCheck.position, 1
you should do private bool IsGrounded() { RaycastHit2D raycastHit2d = Physics2D.BoxCast(boxCollider2d.bounds.center, boxCollider2d.bounds.size, 0f, Vector2.down, 1f, platformsLayerMask); return raycastHit2d.collider != null; } to check the ground instead of the game object. No complications with this approach
Hey, I've been following the tutorial good so far, I'm stuck now, theres these 2 things that happen to the player 1) the player has some sort of weird physics to it, as soon as he starta climbing a ramp of about 45 degrees, he rotates and falls on the ground 2) the ground check thing Doesn't work for me, sorta, My player can't Jump at all. If you could answer My questions, I would be very thankful!
so, a litle update, I fixed the 1) by locking the player on Z axis, and for 2), i managed to make it jump, but it can jump as much as it wants, here's the console error if it can help you with solving this : PlayerController2D.cs(12,15,12,26): warning CS0649: Field 'PlayerController2D.groundCheck' is never assigned to, and will always have its default value null
@@DimeF1 nice work solving rotation issue. The error in the console suggests the ground check object is not assigned in the property inspector, this could be something i missed in the video. In your scene, with player selected, find the ground check nodes and drag them to the player script, into the ground check fields. You will need to assign the left, middle and right ground check.
Hey, I have problem, if player key jump and isGround true , my player cant jump, maybe it didnt detect the groundCheck whenever it collides with Layer Ground, what should i do ?
I’ve been following everything you did in the tutorial, but after I added the ground check thing my character suddenly won’t jump anymore and the run animation won’t work either. What did I do wrong? Note: i fixed it already
Hey mate, try move the ground check position lower so it sits below the ground. Also make sure the ground game object has been assigned a layer named Ground.
Hey guys, great, concise explanation towards making a comfortable movement. Anyone here getting any issues with animation modifications? the spliced sprites aren't recognized when trying to make animations
I just released a new Unity Asset to help beginners make platformer games
► u3d.as/2eYe
that only leads to the asset store, not your page.
I know im asking randomly but does any of you know of a method to get back into an Instagram account??
I was dumb lost my password. I appreciate any help you can offer me!
@Greyson Eduardo instablaster =)
@Jayce Jake I really appreciate your reply. I found the site through google and im waiting for the hacking stuff atm.
Seems to take quite some time so I will reply here later when my account password hopefully is recovered.
@Jayce Jake it did the trick and I now got access to my account again. I'm so happy:D
Thanks so much you really help me out !
Who else is here because Brackeys decided to use a premade movement script?
THIS :'D
EXACTLY THIS!
Yep
@Ahmed Elnaeim his scripts are good enough ( When he actually teaches how to make them from scratch ) , but they're extremely simplified which is great, but in the long run, they really aren't that optimized, I guess that's a conscious choice to avoid overwhelming beginners with some intermediate stuff.
Brackey is trash I ended up confused watching his script vids .his is the worst channel to try to learn from
So much better than all the other 2D PlayerController tutorials I've seen. It's refreshing to see a RUclipsr actually create the controller from scratch, as opposed to recommending a 3rd party script. Please do more game programming tutorials!
Thanks Timothy, you hit the nail on the head with the 3rd party stuff. I have some full game making tutorials planned. Unity is in a transition phase with their Input system which has made making tutorials a problem, as they will all break the moment the new system rolls out. But I'm putting some stuff together. Make sure to sub, and visit the discord to hang out with me and talk gamedev :)
Easily beats brackeys tutorial on this. Really great tutorial!
Thanks so much. I plan to do more in depth game making series shortly. So come back for those! Have a fantastic day
It really is more details than Brackeys that helps the learner understand how codes work. I like this video.
I like Brackeys, but it seems to be more of a showcasing channel nowadays rather than a teaching channel. At least that's my impression.
Yes i love this toutorial and it helps me to learn more
@Susuya Juuzou i don't know I think that brackeys is just more focused on beginners who don't want to code hard code (EG. LINECASTS) BUT i DO THINK THAT SOME of his tuts are pretty good and usefull (eg. cinamachine tutorial). Another really good channel is blackthornprod but his tut on movement didn't help me as much as this one for my game.You just need to find out which channel is best suited for you as the learner
Scripting starts at 18:40 (The intro is pretty basic).
Really appreciate that you didn't ask us to download a premade character controller like the other tutorials did (I hardly learnt nothing with them)
Hey thanks David, I hope you check out my newer vids, I'll be remaking this one very soon for unity 2020. Should be fun!
@@LostRelicGames just finished the tut - best one around (Did you happen to remake this one for Unity 2020 one or latest?)
Hey Everyone. Just in case anyone has problems with the jump after they make the ground check, make sure the GO you are using is below the feet level of whatever char you are using. Decided to share this knowledge, after I struggled with it for two days :D
Thank you, I ran into this same issue and your solution fixed it.
Lad, thanks for the shout! Was confused for a good while xD
Thank you!
Thanks! I was getting very frustrated over this issue haha
omgosh thank you so much lmao. I was so confused on what was wrong lolol
FINALLY SOMETHING THAT WOOOOOOOOOORKS! BETTER THAN BRACKEYS AND BLACKTHORNPROD THAAAAAAAAAAAANKS!
Haha! Thanks for the high praise! It really means a lot. Make sure to check out my latest video and see if I'm on the right track. Will mix it up between that classroom style and this in depth tutorial format.
true
same i camehere cas they didn't work for my game
Nolimo(NOT IN USE Read channel desc) agreed
@@owentheflybyguy hhahaa
The coding tutorial part is awesome. Shows what does what really clearly and simply even for those who have no clue about C#, Unity or OOP altogether, such as myself.
If anyone else missed it at 6:10. If you are missing the SAMPLES part in the animation window, just press the gear on the right side of the tab, and click show sample rate!
Best tutorial on this EVER! - Would be cool to turn this into a series, building a Megaman game step by step :-)
this is a great tutorial. almost every other teacher out there skips important steps and clicks around too fast without explaining all the details of what is going on. So far this is the best. I will be watching more. thanks
Thank you Psychic, more coming soon
Great tut, I'm an artist and a beginner dev. After a month of searching I've found a clear concise tutorial. Thanks for the help !!
Mega Bros, you made my evening! Thanks for stopping by, keep it indie!
I learned more about Unity from watching this tutorial than I have in the several other tutorials I've watched. 10/10
If some people are still having trouble with the ground check, you can just use a collider and us
void OnColliderEnter2D(Collision collision)
{
if(collision.collider.tag == "Ground"){
isGrounded = true;
}
}
and vise-versa
The best 2d movement tutorial i've ever seen. Clear, fairly concise, and the best movement i've seen on youtube. Great tutorial!
23:30 had me laughing. Needed that after ripping out what's left of my hair.
😆
Lmao lol. I love doing silly stuff like that! Keeps me motivated
This video came a day before my birthday a year ago and now the only think I can think of is I could have started that day... but man, without you I don't think I could have started off with the right foot now, I just reconciled with making videogames thanks to you.
I've only watched a few tutorials of yours, but you are by far the best teacher of Unity I've come across. You go over details and explain in a way that non-technical gurus can understand. I"m so excited to watch all of your vids. Subscribed!
If your player is not jumping, try moving your ground check object lower. Also Come chat on discord! discord.gg/yeTuU53
Hey, I know this is a little late but I thought it might be worth noting that it is better to receive inputs in the update method and then call what we want it to do when we hit the key in the fixed update as otherwise we can "miss" inputs from the player, but we also wouldn't want to have everything in update for the reasons you already explained in that it is a physics-based game. keep up the good work with your videos :)
What version of visual studios are you using?
@@kirbotherapto2255 it looks like visual studio 2017 and likely community version, though if you are new just use whatever is a stable release 2017 still fine but 2019s one seems to be fine by now
What if the character is still jumping in the air? I mean it's jumping on the ground but also whenever it is close to the ground, but not actually "touching" it, I wrote all of the code that you wrote and also added the 3 ground checkers, what could be the problem there?
Nvm, this could be kinda douchbagy but I'm gonna recommend another RUclipsr's video for doing good jumps if you're having trouble with this method ruclips.net/video/QGDeafTx5ug/видео.html&t
you're a genius, dude I have been watching Unity tutorials for like 2 years now and you are the best guy doing it I swear to god, your videos are better than some I paid for, thank you
Yo OJ, thanks man, This was actually my first tutorial, so i'm glad it holds up! Appreciate your comment and positivity. All the best to you dude
you can just type for jumping.
if (Input.GetKey("space") && rb.velocity.y==0 )
{
rb.velocity = new Vector2(rb.velocity.x, 6);
it's a lot easier.
The problem with ur code is that u also could jump without touching the ground eg. hitting a celling while jumping. Its just safer doing it with a groundcheck
Or set up something like a bool for isjumping, if(rb2d.velocity.y < 0 || rb2d.velocity.y > 0)
{ isjumping = true; }, then on the if for the Input.GetKey add && !isjumping
Thank you so much for this video. One of the few tutorials I could find where the guy actually takes his time to explain most of the stuff he does instead of just speedrunning it
Hey thanks a lot, glad to have you as a viewer!
i have a prolem with the linecast, everytime i implement the code and create the object, i cant jump anymore.
Yea same here..
You want to make sure that your GroundCheck empty is slightly below the bottom of your BoxCollider2D, otherwise it'll never actually be touching the ground
Use this:
public bool isgrounded;
void OnCollisonEnter2D(Collider 2D collison){
if(collison.gameObject.CompareTag("Ground"){//insert Ground tag to platfrom
isgrounded = true;
}
}
//this will check make isgrounded true when touches the ground
void OnCollisonExit2D{
if(collision. gameObject.CompareTag("Ground"){
isgrounded = false;
}
}
//will not allow player to jump infinite
void OnCollisionStay2D(collider2d collison){
isgrounded = true;
}
}
//it will allow player to jump if between two platform
Then insert isgrounded boolean to jump input
Instead of all Ground layers and groundCheck gameobject & layermask etc..just write this code for jumping section:
if (Input.GetKey("space") && Mathf.Abs(rb2d.velocity.y)< 0.001f)
{
rb2d.velocity = new Vector2(rb2d.velocity.x, jumpForce);
animator.Play("Player_jump");
}
// jumpForce just a float variable I used.
@@Stellar-Cubes THANK YOUUUU. Solved the problem for me!!! :)
All I wanted was a tutorial that showed me how to get my animations and graphics on screen and moving/jumping, that's it. After a few days of searching I come across this absolute gem of a tutorial. THANK YOU.
Hmm, I keep getting a warning return as :
Assets/Scripts/PlayerControllerV2.cs(14,15): warning CS0649: Field 'PlayerControllerV2.groundCheck' is never assigned to, and will always have its default value null
So, it thinks my Transform groundCheck isn't referencing anything?
Serialized Private fields, like groundCheck in this code, will always give this warning as you assign the value in the inspector, not in the code, so the code doesn't know it has already been assigned. Feel free to completely ignore this.
i have the same problem, did you found a fix?
Edit: you just need to initialize groundCheck with null
@@dr.jackshephard4733
Thank you mate!
Or just ignore it.... It's not an actual error it is just your Script not being smart enough to read that you assigned it in the Inspector. It isn't gonna realize all of a sudden that the value was assigned since you didn't specify specifically in the script. Code is incredibly overly specific because it is translating into 0 and 1 for the computer to process. The computer itself can't read text it has no idea what anything you write means, it's the Code Editor itself that turns your words into binary for the computer.
Wait guys this is Video Game Animation Study
I'm almost mad how helpful this was. you're telling me I spend 4 hours trying to code it correctly and did it all over again without fail in less than an hour.....auwch. amazing tutorial thanks.
This is incredibly useful, one to bookmark for sure. I always have problems getting 2D characters set up just right, but this video really points me in the right direction.
I'm glad you see the value! Thanks for the comment.
Man, I love Brackeys, but this is the best tutorial if you want to fully understand how to create the basics of player movement script. Well done, Lost Relic!
This video helps a lot to understand how we use code and animation properly in game.
Far from optimal practicies, but very simple and for the most part well-explained. Just what a beginner needs!
Hey mate, my first tutorial actually so a little sloppy in places, with some bad habits I picked up from other material, which I've since corrected for newer video. I really appreciate the comment mate, It helps a lot! :)
@@LostRelicGames ty, I'll definitely check the new one out!
I had to watch this a second time just because the jump animation was glitching out. 10/10 tutorial.
Thank you very much for you, I finally found a very good tutorial and added to my knowledge. I hope you get a reward for your kindness to teach all of this. I'm waiting for the next lesson
"I gotta say Mega Man 3 was easily my favourite one"
Never have I ever agreed with someone so much.
The best tutorial about 2d platformer I have come across, Thank you! Finally I am able to make a working jump with no buggy animation.
Man, after a long time search this is the best Tutorial I've seen!
Instantly Subscribed.
I'm really glad you enjoyed it! Thanks for the comment dude
This is the first 30+ minute tutorial video i watched and every minute was worth it.
Thank you for this in-depth tutorial this is waaaaaaaay better than any video or website I've come across so far!
Been looking for a tutorial on this for so long by far the best one I have came across. Thanks for the help :D
Will be watching much more of your videos
Very easy tutorial to understand ... even better than Brackeys :)
Thank you! Awesome tutorial!
Did you [SerializeField] for groundcheckL & R? I don't get how those fields appeared in your Player inspector. I had to add variables similar to the Transform groundCheck we created earlier in order to get it working.
How did you do it? Player Inspector didn't even show runSpeed/jumpSpeed for me
@@belebs runSpeed needs to be a public float instead of a private.
public float runSpeed;
If you leave it as a private float you need to use [SerializeField]
[SerializeField]
private float runSpeed;
man, excelent tutorial, you do things in a way thats easy to understand. and thats something hard to find on yt. congrats
Wow, Point looks much clearer, I had been wondering why my pixel sprites looked much worse. Thanks!
Wait yours worked??
Outshines any other tutorial in YT. Thanks for helping learn even with a year and a half old video!!!
This seems like a really great tutorial! Ive set Up some 2D controllers before but its always useful to watch other people do it! I Hope you make more tutorials in the future :D
Ha thanks Thomas! That's the thing with Unity, there are so many approaches to typical tasks like this. I remember trying many when i was first starting. I Appreciate the comment!
thanks SO much, you helped me understand coding better than any tutorial so far
Fantastic. I actually wanted to learn HOW to program a basic 2D character controller, not just download a pre-made one and run it. This helps out a lot when it comes to getting started with that. Thanks so much for the information.
I just watched another video about character movement but it feels wrong in many ways that now make sense. Love your content!!
My code was working up until 35:46 and I am not able to jump anymore can anyone help me out?
Try moving your ground check game object down (so it sits below the ground line).
Thank you so much for sharing your knowledge. Binge watching your content these days. I really like your take on things.
PLS HELP!!
Assets\Scripts\PlayerController2D.cs(14,15): warning CS0649: Field 'PlayerController2D.groundCheck' is never assigned to, and will always have its default value null
Even Though i dragged The GroundCheck Empty to a link, checked if there are some mistakes in the script.. Everything is fine, but still the same mistake
Cant fix it for hours! pls help((
same here man...
Even though i'm basically just ctrl+c ctrl+v your code with extra steps still helped me learn a lot, Thank you
Best tutorial I have ever used. Everything on the tutorial was presented in Unity correctly. I am squealing like a little girl seeing my ogre dude walk.
You are so unbelievably good at explaining why things are the way they are. Please keep uploading tutorials!
man, thanks so much, that makes me happy to hear. Comments like these will 100% keep me making more.
5:30 "Epileptic Blinking Frenzy" Yea... that got me LMAO
THIS is a good tutorial, much better than a lot of big chanels that make the same.
What an awesome tutorial! I am developing also a Megaman project in my free time and your videos are really easy to follow. Thanks a bunch!
Glad you liked it, and welcome to the discord! Hope to chat about mega man more in the future! :)
I've been stuck for ages but this was a breakthrough. Really good stuff
I started looking into unity as of recently and I was really looking for a video like this, that lets me actually understand the coding behind the character controller itself. The linecast was a really nice addition to learn, and everything was so simple and on point that even my dumbass could understand. Every person starting in unity needs to watch this. Subbed
Thanks so much for your feedback! I'll continue refining the teaching process further - talking through ideas and decisions, not just blindly typing them like man do. Welcome to the channel! Here's an invite to the discord if you ever need to discuss the tutorials or game dev in general: discord.gg/yeTuU53
THIS IS AN AMAZING VIDEO TO WATCH FOR BEGINNERS! IT HELPS WITH THE BASICS. I CAN'T BELIEVE IT
My dude I love this, yea brackeys seems like hes had a hard time keeping up with new changes, he is more about marketing new features. You have arrived at an opportune time in my opinion. Loved the video and it helped me really get my game started.
Hey thanks man, I really appreciate it ay. And I do agree that most channels are glossing over the details. Glad you enjoy the format! All the best on your game dev journey.
Best Unity tutorial so far! Can you do more tutorials please? Like shooting, grabbing, inventory system, game menu, game over, settings tab, skills tab etc...
Thanks to this video i finally understood the basics of animation , thanks a lot.
Idk how you have the answer to every problem but you are a god
Thanks so much for this tutorial! I'm making my first game in unity and this is very helpful and well explained.
Thank you!! I've learnd very much with this video! Best Tutorial I found on RUclips for Animating and Controlling an Charakter!!!
Hearing your victory screech after getting the code right......... That spoke to me, mannnnn LOL
My chatacter plays all the animation at the same time.. like when i jump it plays both idel and jump animation, and if i press a or d while jumping it plays three animation at the same time,m
what i used to do the ground check was:
if (rgb2d.IsTouchingLayers(LayerMask.GetMask("ground"))){}
dont know if it have bugs later on, but i find it easier to understand. :D
Great video! I'm making a Mega Man Zero style game and this helped me understand how to manipulate the PlayerController somewhat to replicate the feel of specifically Mega Man Zero 3, which I'm playing at the moment.
I've followed your instructions as close as possible but I keep running into
"Warning CS0649 Field 'PlayerController2d.groundCheck' is never assigned to, and will always have its default value null Assembly-CSharp"
Please help me!
Also I am able to see the left & right run and jump animations, but my character is Running in-place.
same here :/
45:53
Thank you so much for this tutorial! It really helped me to understand a lot of the concepts. The only thing im not totally getting is the jumping, is there any way you could do a more in depth tutorial on it? Maybe making a whole jumping system for like a double jump or something. Either way love what you're doing and cant wait to go through your other tutorials!
THIS IS IT, Thank you very much man, keep doing tutorials, we appreciate it
I did the part of the ground check, and I got all the programming alright too (I've checked it twice). When I press the jump button nothing happens, as the ground check thinks I'm not grounded. Someone can help?
in 35:32 of the video
@@reimanas Having the same issue, the character doesn't jump when I put in the if statement
Were looking for this tutorial all day
Oh man I've been awaken for whole night , I tried grasping basics of unity , now I'll work on C# for few hrs as I've already some experience in OOP from C++, I don't think C# will be a trouble
"Assets\Scripts\PlayerController.cs(15,15): warning CS0649: Field 'PlayerController.groundCheck' is never assigned to, and will always have its default value null"
it is assigned, did someone have a similar problem and got the answer?
btw amazing tutorial
Did you solve this? If not here is an invite to the channel discord. I can help you better there! :)
discord.gg/wdWfKZV
Did you fix this? Because I have also encountered the same problem and I'm quite stuck.
@@lexonbee I'm having this issue aswell, right now :s Did you fix this in the meantime perhaps? i was ok up untill that groundcheck. gdmn groundchecks..
@@senseoffender9655 no i just quit unity
Great tutorial, helped me a lot! I have a question though, so I would really appreciate if someone out there could help me out.
So when you jump from the ground under a low platform, sometimes it jumps immediately after the grounchecks meet the platform; which i think is not a great player experience in my project. (Check 43:53 to see a visual example of it) I want my character to land first, then jump. How can I avoid the immediate jump to happen? Thanks in advance!!!
You can make a cooldown to jump after landing. Add the "wasJumping" (false by default) variable, which becomes true after the jump start. While it is true, the character cannot jump again. Then add to the successful ground check the "wasJumping" variable check and if it is true, then turn on the independent cooldown and at the end make "wasJumping" false.
I have not tested this in practice. :)
Or if you want your character to not jump without pressing a button again:
then use GetKeyDown instead of GetKey to jump.
@@urgian Yep, GetKeyDown was the thing I was searching for! Thank you so much.
Knew a lot of it, but flipX was new to me. Thanks 👍
Excellent tutorial! I'm coming from GameMaker Studio and this answered lots of questions :)
Glad to hear it! New series starting soon so stick around! :)
At 22:14, why are you checking for input in FixedUpdate? Isn't that against the Unity recommendations?
As far as I understand checking for input in FixedUpdate may cause your key strokes not to be recognized sometimes.
Absolutely. This was one of my early tutes, a few mistakes here and there. Input checks should most certainly be done in input.
Really love this tutorial. One of the best ones I have ever seen.
Once I finished all the animations and movement, my desktop's power cord decided to come unplugged. Nothing saved
Proper work my friend, thank you for your efforts on these tutorials.
Hi at around 42:40 you can see that the player gets stuck on the side of a wall when pressing the run into it, this is happening in my project as well. Unfortunately the solution only works if you want to make a one way platform rather than a platform the player can not jump through. How would you prevent the player from getting stuck on the side of a platform that they cannot jump through?
This help lots thanks so much for tutorial i learn so much from it! I love ur sense of humor and your games! defentialy subbed!
Apericiate Your work as beginner hay wire while creating movement this helped....It's in depth ...!!Thanks man
You are welcome! my pleasure
@@LostRelicGames Hey man!! I had lil trouble.
Well My tile isn't one so i have put it on GameObject called Tiles!!
Now here is the problem..when i tries to jump the play it won't buzz a inch!!
Well my character left , right movement is work when i play
------------------------------------
c0de
----------------------------------
if(Physic2D.Linecast(transform.position, GroundCheck.position, 1
Great tutorial! Very clear. I'm bookmarking this as a reference for sure.
you should do
private bool IsGrounded() {
RaycastHit2D raycastHit2d = Physics2D.BoxCast(boxCollider2d.bounds.center, boxCollider2d.bounds.size, 0f, Vector2.down, 1f, platformsLayerMask);
return raycastHit2d.collider != null;
}
to check the ground instead of the game object. No complications with this approach
Hey, I've been following the tutorial good so far, I'm stuck now, theres these 2 things that happen to the player
1) the player has some sort of weird physics to it, as soon as he starta climbing a ramp of about 45 degrees, he rotates and falls on the ground
2) the ground check thing Doesn't work for me, sorta, My player can't Jump at all.
If you could answer My questions, I would be very thankful!
so, a litle update, I fixed the 1) by locking the player on Z axis, and for 2), i managed to make it jump, but it can jump as much as it wants, here's the console error if it can help you with solving this
: PlayerController2D.cs(12,15,12,26): warning CS0649: Field 'PlayerController2D.groundCheck' is never assigned to, and will always have its default value null
@@DimeF1 nice work solving rotation issue. The error in the console suggests the ground check object is not assigned in the property inspector, this could be something i missed in the video.
In your scene, with player selected, find the ground check nodes and drag them to the player script, into the ground check fields.
You will need to assign the left, middle and right ground check.
@@LostRelicGames the ground check object is assigned in the property inspector, you didn't miss it in the vid but I am still getting the same error
I love the way you sound so excited when you get him to skate across the platform:o)>
Hey, I have problem, if player key jump and isGround true , my player cant jump, maybe it didnt detect the groundCheck whenever it collides with Layer Ground, what should i do ?
Same happening to me, don't know what to do, getting frustrated, if you find a solution, please let me know :)
i moved the box collider up a bit from the bottom and it worked somehow
(Physics2D.Linecast(transform.position, GroundCheck.position, 1
lines must reach ground layer to work successfuly
@@TheRecca07 is it correct, I had the same problem, but I move the collider a few millimeters more down, and working correctly.
Thanks a lot! I love how you did this from scratch and how people can easily take this and customize it and make it their own. :)
i really liked your way of teaching please don't stop!!!! keep on going!!
your channel will have 1 million subscribers very soon keep the great work up nice tutorials
Haha I wish! Thanks so much for the positive comment, new one this weekend hopefully!
I’ve been following everything you did in the tutorial, but after I added the ground check thing my character suddenly won’t jump anymore and the run animation won’t work either. What did I do wrong? Note: i fixed it already
Thanks so much for the help I now feel ready for my first unity jam (I'll try to remember to reply to this comment to say how it went)
35:09 I've followed the tutorial step-by-step here and after this moment the jump function no longer works. Any common reason/ mistakes made for this?
Hey mate, try move the ground check position lower so it sits below the ground. Also make sure the ground game object has been assigned a layer named Ground.
@@LostRelicGames moving the ground check lower worked. Thanks for your help much appreciated!
Hey guys, great, concise explanation towards making a comfortable movement. Anyone here getting any issues with animation modifications? the spliced sprites aren't recognized when trying to make animations
I don't know why but even with the ground check-in place exactly as in the video the character still jumps when I hold down and/or spam space
Whenever i put the && isGrounded in (Input.GetKey("space") && isGrounded ) i can no longer jump. Help would be appreciated.
Same here! And I tried to mess with it but I couldn't figure it out!