Best tutorial I could find on Unity 2D Platformer! All other tutorial often go too fast or is using too many outside resources that is hard to follow. This one is just simple and perfect to get started! Thank you!
I've tried so many times to make games using both Unity and Unreal Engine, but never did anything with it, however this video was very simple and useful, and I absolutely loved it. Thank you so much for making this.
i like the fact that you explain what the code does, not just doing it. the other tutorials i see from other youtubers, are like just copy what i do even if you dont know what this does
Basically just hit the keys and hit the head to the wall until something happens on the screen and repeat the same over and over again. Just be patient with yourself, try different methods of learning etc. After watching tutorials try to build something using the concept you just learned, seek help and reminders after you stuck a dead end, try by yourself first. Slow by slow kick the bar higher and repeat the same learning process. Try to learn the logic behind the code concepts, but for sure you don't have to know everything. Eventually you will learn something. Building small projects again and again and then adding always some new and difficult to the project
if you dont want to jump iwht space but instead vertical, just but in the quoations "Vertical" then go to edit -> project settings -> input manager -> axes -> vertical , then make sure there is nothing in the negative and alt negative
Thanks! That game was made around 3 years ago now, it was my first ever game, so doesn’t have a lot of the typical functionality a good game should. It saves ur progress by loading you into the level and saving the level ur in via an int :)
There's a bug in this game" if you add a wall with a collider and everything, if you hold the AD keys when touching it, your character will stick to the wall.
I thought that brackeys is the best tutorial to watch but after 2 minutes I didn't know what's going on... but you just keep it very simple and you explain everything very well keep it up. I'm going On the next tutorial so bye 👋
22:37 BIG REMINDER to be mindful of how you're naming things! I was scratching my head why the "End" didn't load Scene2/level2 on collision. Welp! Named the Scene "Level 2", and upon putting the code, I put "Level2", sooo that space had me running loops for a good 3 minutes lol. I always forget how literal, word-by-word scripting/coding is...
I am using the new unity version and I think you will need to set Rigidbody2D in PlayerMovement script to public 'cause set it to private will make Rigidbody2D cannot work
At 15:53 in the video, my recommendation is to not change “collision” to “other” as when I changed it to “other” my jumping did not perform correctly. But keeping it as “collision” made it work perfectly
There's a bit of a flaw in the way you coded your jumping. Whenever I'm against an object, even when there's no ground beneath it, I'm able to jump. Sometimes I hit an edge at such an angle that it disables my jump when I land, thinking that I'm still against it. Any idea how to fix that?
I set my speed to private and didn't declare it I just assigned it there and then. I prefer it that way. Works great if anyone else wants to use it 'private float speed = 10f;'
Thank you for this tutorial, Blakey, you really helped me out here. It was straight to the point and clear so I could copy everything neatly. You are a lifesaver.
hello to if your rigidbody and your monobehaviour arent working youve got to go to edit in the editor>prefrences>External tools and then set external script editor to the current code program your using in my case VS(Visual Studio)
Microsoft Doesn't let me download Visual Studio so I have to go on a Third-Party Website to Download it Edit: Also I use an Older Version of Unity And have no idea Where Compiler Errors are.
Hi I used this tutorial and when I implemented the movement part it gave me a syntax error and wouldn't show up in components tried one I found on stack over flow and didn't work either can you help? btw I was using unity 2020.3.
For some reason, my duck (which is what I used as the sprite) will spin randomly (when it goes over a corner too far or something similar, it will rotate around and it is quite annoying if I'm honest)
For anyone who can get the menu to work, but clicking the resume button does nothing, the text needs to be the child object of the button. Dont know why thats the case but i figured it out
You explicated the code really good and like @Orpheus YW said the other tutorials of how to make a platformer on unity2D uses other sources or they are just simply not finished definitely subscribing
Hi loved the tutorial. Helped me a lot and maked me take my first steps. But, thee movement and jumping scriptt didn't work to me. Do you know a script for only jumping? I would really apriciate it. Thanks for all!!!
Any one who’s sees this he was most likely using a different colour scheme so it may not be the same, and if the code doesn’t work check for capitals and semicolons and mistakes the smallest mistake can cause problems and the whole thing won’t run
Thank you for this tutorial itll help me learn the basics of unity I'm going to try and make other games with the code that I learned and further improve my coding skills
ERROR : Assets\PlayerMovement.cs(43,18): error CS0111: Type 'PlayerMovement' already defines a member called 'OnCollisionEnter2D' with the same parameter types
Please help I tried to rename the project while it’s opened and everything got corrupted😭 does anybody know how to fix it😭😭😭😭😭😭😢😢😢😢I hope someone replies🙏🙏🙏
How to make smooth camera movement: public GameObject target; public int smoothing; void Update() { float x_diff = (target.transform.position.x - transform.position.x) / smoothing; float y_diff = (target.transform.position.y - transform.position.y) / smoothing; transform.position += new Vector3(x_diff, y_diff, -10); } feel free to copy
WTF THANK YOU THANK YOU THANK YOU!!!! I WAS LOOKING FOR A SUCH A GOOD VIDEO LIKE THIS AND I FOUND IT!! YOU HELPED ME SO MUCH!!!! Edit: at the void command lines I stuck bc this shows error here (help)
@@bblakeyyy Yay its works, but sadly the player is still able to jump on the ground. And i just remember today that I ask this question 12 days ago lol
fist game ive made I wasn’t able to figure out the pause menue bc my buttons just wont work but thats fine. I had so many probloms with coding that took me hours to figure out but finally did it. geat tut !
I think the button and text objects shouldn't be siblings because then you click the buttons (I found out after some time). So i've parented the button object for the text object, and now the button objects aren't obscured by the text objects.
@@Yrekcaz7 Im very late but I had the same issue and found that you need to press ctrl+S to save the script in visualstudio which will make it update in Unity, I think this video is just a tad outdated
Everything works amazingly, even figured out what i was doing wrong with the buttons except that everything ABOVE resume selects resume, but if im anywhere below it highlights quit. Is there a way to make it to where the only place you can select is the actual buttons and not anywhere around them?
Bug with the Pause Menu Buttons, it works in my level 1 scene but not in my level 2 scene. I can still use the escape key to access the pause menu, it’s just the buttons that are doing nothing.
@@rrodann using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerMovement : MonoBehaviour { public float speed; public float jump; public bool isJumping; private Rigidbody2D rb; // Start is called before the first frame update void Start() { rb = GetComponent(); } // Update is called once per frame void Update() { float move = Input.GetAxis("Horizontal"); rb.velocity = new Vector2(speed * move, rb.velocity.y); if (Input.GetButtonDown("Jump") && !isJumping) { rb.AddForce(new Vector2(rb.velocity.x, jump)); isJumping = true; } } private void OnCollisionEnter2D(Collision2D other) { if (other.gameObject.CompareTag("Ground")) { isJumping = false; } } private void OnCollisionExit2D(Collision2D other) { if (other.gameObject.CompareTag("Ground")) { isJumping = true; } } }
SIR, HOW CAN I JUMP FROM LEVEL 2 TO LEVEL 3 ----I DID TRY TO CHANGE IN FINISHLINE BUT WHEN I CHANGE LEVEL 2 INTO LEVEL 3, IT DIRECTLY JUMPS FROM LEVEL 1 TO LEVEL 3???? ------PARDON MY GRAMMER...
You have a FinishLine Script in the "Level1" and "Level2" Scenes right? On the Script for "Level1" you set "SceneManager.LoadScene(...)" to "Level2", then change the Script for the "Level2"-Scene to "SceneManager.LoadScene(...)" to "Level3". Adjust names to whatever your Level-Scenes are named.
Please help! I'm currently stuck on the Scene loading part as it won't let me start my game as an error keeps showing saying "The name 'Level2' doesn't exist in this current context". How can I fix this?
This video is great!! But for some reason I cant get the player to move, even after i typed in the script and connected it to the player, the gravity does not even work
I have a ton of scripts and assets related to this and my other tutorials that can help you out on my Patreon:
www.patreon.com/BlakeyGames
How many levels this game have?
i cant make the player jump
@@Magic8112 me too
Best tutorial I could find on Unity 2D Platformer! All other tutorial often go too fast or is using too many outside resources that is hard to follow. This one is just simple and perfect to get started! Thank you!
no probs!
I've tried so many times to make games using both Unity and Unreal Engine, but never did anything with it, however this video was very simple and useful, and I absolutely loved it. Thank you so much for making this.
WOW!! AMAZING!!!! This channel is TOO underrated, this was easy to understand and super simple to follow!
i like the fact that you explain what the code does, not just doing it. the other tutorials i see from other youtubers, are like just copy what i do even if you dont know what this does
Very good video! This is the best 2d platformer tutorial that I've found because most tutorials start with a tile-set which makes it hard to follow.
glad to hear that!
Best tutorial I've found so far. No frills or pointless gabbing, just straight to the point, concise good information. Cheers mate
I was so flipping happy when I did the movement script tears came, thank you so much 🙏
Glad to hear that my friend!
its been 5 years since i used unity this was the refresher as simple as it was i really needed it .Good jump !!
The code to stop jumping mid air won't work
Ye i have the same problem
My problem is This Compiler Error thing. I have no idea Where that is
Great Tutorial. One of the best tutorial I found. It’s not to fast or to slow. Just the correct speed.👍
BRO! I have been looking around for a tutorial like this for AGES! thank you so much!
Basically just hit the keys and hit the head to the wall until something happens on the screen and repeat the same over and over again. Just be patient with yourself, try different methods of learning etc. After watching tutorials try to build something using the concept you just learned, seek help and reminders after you stuck a dead end, try by yourself first. Slow by slow kick the bar higher and repeat the same learning process. Try to learn the logic behind the code concepts, but for sure you don't have to know everything. Eventually you will learn something. Building small projects again and again and then adding always some new and difficult to the project
Good advice!
@@bblakeyyy Thanks for your help! By the way, background music did not get unnoticed, great and relaxing atmosphere 🎼
if you dont want to jump iwht space but instead vertical, just but in the quoations "Vertical"
then go to edit -> project settings -> input manager -> axes -> vertical , then make sure there is nothing in the negative and alt negative
Best tutorial on 2D plattformer imo. I will make my own 2D game eventually, thanks for your help.
Glad to hear it dude!
@@bblakeyyy thanks! I played your invisible platform game and loved it so much!!! But how does it save your progress? And how do I go back to menu?
Thanks! That game was made around 3 years ago now, it was my first ever game, so doesn’t have a lot of the typical functionality a good game should.
It saves ur progress by loading you into the level and saving the level ur in via an int :)
@@bblakeyyy Great thanks
i have watched dozens of videos, to ensure that i am able to find the proper videos to help me. and yous are perfect. you deserve much more.
This video makes all the concepts so much easier even a year later. Keep it up! 👍
There's a bug in this game" if you add a wall with a collider and everything, if you hold the AD keys when touching it, your character will stick to the wall.
Love your tutorials dude. Thank you so much for all the help and keep up the amazing work!
I thought that brackeys is the best tutorial to watch but after 2 minutes I didn't know what's going on... but you just keep it very simple and you explain everything very well keep it up. I'm going On the next tutorial so bye 👋
Great tutorial! Watched until the end and everything worked. I am new to C# but you explained the code very well. Keep it up, homie.
amazing channel! i cant believe this quality only has 2k subs definitely subbed
It doesn’t let me grab the rigidbody2D.. can someone help? I don’t know what I did wrong. I’m using vs2022 btw
22:37 BIG REMINDER to be mindful of how you're naming things! I was scratching my head why the "End" didn't load Scene2/level2 on collision. Welp! Named the Scene "Level 2", and upon putting the code, I put "Level2", sooo that space had me running loops for a good 3 minutes lol. I always forget how literal, word-by-word scripting/coding is...
I am using the new unity version and I think you will need to set Rigidbody2D in PlayerMovement script to public 'cause set it to private will make Rigidbody2D cannot work
Ty bro I wondered why speed didn’t show up even though it was public😅
ur a legend with me it didnt work but thank you smh
At 15:53 in the video, my recommendation is to not change “collision” to “other” as when I changed it to “other” my jumping did not perform correctly. But keeping it as “collision” made it work perfectly
Your issue was most likely elsewhere, changing to other should not cause issues
Great video just finished half now and going going to finish it tomorrow
There's a bit of a flaw in the way you coded your jumping. Whenever I'm against an object, even when there's no ground beneath it, I'm able to jump. Sometimes I hit an edge at such an angle that it disables my jump when I land, thinking that I'm still against it. Any idea how to fix that?
try to give a extra space in your collision compared to the sprite
yeah i saw this but in a way i kind of like it
I set my speed to private and didn't declare it I just assigned it there and then. I prefer it that way. Works great if anyone else wants to use it 'private float speed = 10f;'
Yup
this is the most helpful video that i've watched for unity. great explanations thank you!
This and GMKT are the best Unity Tuts on UA-cam frfr
Thank You! It was my first time I started to make the games and you really helped me to get in! God bless you, bro!
Thank you for this tutorial, Blakey, you really helped me out here. It was straight to the point and clear so I could copy everything neatly. You are a lifesaver.
You spell it bblakeyyy
It’s alright, I actually go by Blakey on discord and stuff so works out :)
@@bblakeyyy ok
Deserves a sub with all notifications best one out of the 13 tutorial video and easy!
Edit:I did not expect to get a heart but thank you:)
i copied the code for moving but it don't work
You also have to adjust the things and stuff
hello to if your rigidbody and your monobehaviour arent working youve got to go to edit in the editor>prefrences>External tools and then set external script editor to the current code program your using in my case VS(Visual Studio)
Microsoft Doesn't let me download Visual Studio so I have to go on a Third-Party Website to Download it
Edit: Also I use an Older Version of Unity And have no idea Where Compiler Errors are.
Hey! I have a tutorial channel dedicated to just tutorials now! It can be found on my featured channels list!
Hi I used this tutorial and when I implemented the movement part it gave me a syntax error and wouldn't show up in components tried one I found on stack over flow and didn't work either can you help? btw I was using unity 2020.3.
@@notmelloyello Mind providing the script? Copy and paste it here
9:45
how do i add double jumping
Brilliant. A whole, simple game. All I need to do now is swap out for sprites and duplicate assets everywhere. Thank ewe Bblakeyyy
Legend! Simple and straightforward, with good explanations!
glad to hear it! subscribe to the second channel for more tutorials!
the jump doesn't work
For some reason, my duck (which is what I used as the sprite) will spin randomly (when it goes over a corner too far or something similar, it will rotate around and it is quite annoying if I'm honest)
@thinic1Just got to working on the game now, that fixed it, thanks for the help!
underrated channel +1 like
For anyone who can get the menu to work, but clicking the resume button does nothing, the text needs to be the child object of the button. Dont know why thats the case but i figured it out
tyy
ty
Thanks dude
I have been trying to figure out player controls forever now thank you so much!
This was an amazing and extremely helpful video, thank you and keep up the good work
This video was so good I'd buy you a free cup of coffee at the Jiffy Lube waiting room.
That is so randomly specific
This did also leave me baffled but appreciated nonetheless
Excellent video! Simple enough to understand, but not TOO simple. Thanks.
You explicated the code really good and like @Orpheus YW said the other tutorials of how to make a platformer on unity2D uses other sources or they are just simply not finished
definitely subscribing
So Clear, Useful, Easy to learn and advanced at the same time
All the thanks to you^^
I can’t do the rigidbody. It won’t highlight
Hi loved the tutorial. Helped me a lot and maked me take my first steps. But, thee movement and jumping scriptt didn't work to me. Do you know a script for only jumping? I would really apriciate it. Thanks for all!!!
Thanks, I found this very good. Not simple, but that’s not your fault. It was the computer.
in the script for the basic movement part, when I added it as a component, the option speed didn't show up, did anyone come across the problem?
mine for example doesn't make statements like Rigidbody2D and Vector2 green. Is that normal?
Although it works
I have never programmed
I’m glad I’m not the only one
the first script doesn't work for me, a lot of the text isn't highlighted
Same for me did u solve the problem yet ?
@@Chubzdoomer thank you
@@Chubzdoomer You are a literal GOD my friend!!!!! Thank you from the bottom of my heart
Its not working for me too
Any one who’s sees this he was most likely using a different colour scheme so it may not be the same, and if the code doesn’t work check for capitals and semicolons and mistakes the smallest mistake can cause problems and the whole thing won’t run
Thank you for this tutorial itll help me learn the basics of unity I'm going to try and make other games with the code that I learned and further improve my coding skills
ERROR :
Assets\PlayerMovement.cs(43,18): error CS0111: Type 'PlayerMovement' already defines a member called 'OnCollisionEnter2D' with the same parameter types
Very friendly to mobile viewers. Good and fast tutorial to start create your first platformer game.
Friendly to PC viewers too! Really simple to follow, and I'm watching this on a computer!
this was a amazing tutorial it is my first game and since you explained the code good. i can now do some stuff on my own, Thank you!
Please help I tried to rename the project while it’s opened and everything got corrupted😭 does anybody know how to fix it😭😭😭😭😭😭😢😢😢😢I hope someone replies🙏🙏🙏
my computer
doesn't have the requirements for visual studio what should i do
is it just me or is the ground check not working
Not just u.😩 I can't get "private void OnCollisionExit2D(Collision2D other) " it is killing me and I want to give up!
same
where is the next episode bro?????
How to make smooth camera movement:
public GameObject target;
public int smoothing;
void Update()
{
float x_diff = (target.transform.position.x - transform.position.x) / smoothing;
float y_diff = (target.transform.position.y - transform.position.y) / smoothing;
transform.position += new Vector3(x_diff, y_diff, -10);
}
feel free to copy
The end cube which is meant to transport you to the. New level does not work . I am using the new input system for movement as well
20:11 you dont have to use a script for the camera, you can just parent it to the player object
ty, my camera script was broken and i had no idea what to do
@@Physicsless8 no problem, it's also very good for 3d games too
I can't find my script in the components
WTF THANK YOU THANK YOU THANK YOU!!!! I WAS LOOKING FOR A SUCH A GOOD VIDEO LIKE THIS AND I FOUND IT!! YOU HELPED ME SO MUCH!!!! Edit: at the void command lines I stuck bc this shows error here (help)
I did the movement script EXACTLY how you did it, but there is no speed variable in the component.
Please comment why.
I can’t comment why if you’ve said you’ve done it exactly how I’ve done it yet it doesn’t work
@@bblakeyyy oh damn...
im having the same issue as well
Whenever my player hits the side of a wall, he just grabs the wall and doesn't fall. Is there a fix to this?
I finished ! it's a very good tutorial Thank you !
👍🏻
THANK YOU SO MUCH! THIS TUTORIAL IS SUPER EASY!!! I CAN FINALLY MAKE 2D GAMES!
My first time i make a game in unity thanks bro
Why my pause menu is not working? It shows up like 1sec and disapears.
i have the same issue
Answer pls how i fix it
@@santtu8684 i dont know
This tutorial is very good but i have one question.When i go to new component and type player movement there isn't my script.Please help me bye:)
you got a new subscriber very clear and beginner friendly
My door simply doesn't work, i have made sure that there are no typos and I added it to build settings but when I touch it nothing happens
make sure the player actually has the 'player' tag that you're referencing in the script.
Is there a way to make the player cant stick himself with the side part of the ground? ( I hope someone understands what I mean )
add a physics material with 0 friction
@@bblakeyyy Yay its works, but sadly the player is still able to jump on the ground. And i just remember today that I ask this question 12 days ago lol
fist game ive made I wasn’t able to figure out the pause menue bc my buttons just wont work but thats fine. I had so many probloms with coding that took me hours to figure out but finally did it. geat tut !
Every legend started here... o7 o7 o7
in the 22:19 of the vid i acsidntly pres on the other opthion(not on the relode) it delted olmost evry thing, what can i do. pls help
I think the button and text objects shouldn't be siblings because then you click the buttons (I found out after some time). So i've parented the button object for the text object, and now the button objects aren't obscured by the text objects.
Amazing, simple and well explained.
12:16 I do it right like you but I cant choose the speed can you help me?
me neither :|
@@Yrekcaz7 Im very late but I had the same issue and found that you need to press ctrl+S to save the script in visualstudio which will make it update in Unity, I think this video is just a tad outdated
Yea bro idk I guess he’s stupid
@@Plapp_but i got an error
i cant find player movement on the components
Everything works amazingly, even figured out what i was doing wrong with the buttons except that everything ABOVE resume selects resume, but if im anywhere below it highlights quit. Is there a way to make it to where the only place you can select is the actual buttons and not anywhere around them?
The best video ever , thanks 😃
Hi bblakeyyy when I change my speed for my player then press play it makes it 0 and when I press the button for moving it only goes to 1 pls help
Hello pls help
@@godofgames666 ctrl s to save changes
@@parkher4186 thx bug I’m already done with the game
Does anybody have any ideas on how to flip the character when you move?
Finally, a good tutorial.
Bug with the Pause Menu Buttons, it works in my level 1 scene but not in my level 2 scene. I can still use the escape key to access the pause menu, it’s just the buttons that are doing nothing.
I have the same problem
anyone know how to fix the pause menu, all I see is the cursor, the buttons don't work ( no script errors )
did you find a fix
OMg this is amazing tutorial, please upload more tutorial i really learned new things but i am having some issue
Best tutorial out there !
the movement script didnt work for me, i even checked every line to see if it was the same so i asked chatgpt to make it and it works
how did it work?? can you help me please
@@rrodann
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
public float speed;
public float jump;
public bool isJumping;
private Rigidbody2D rb;
// Start is called before the first frame update
void Start()
{
rb = GetComponent();
}
// Update is called once per frame
void Update()
{
float move = Input.GetAxis("Horizontal");
rb.velocity = new Vector2(speed * move, rb.velocity.y);
if (Input.GetButtonDown("Jump") && !isJumping)
{
rb.AddForce(new Vector2(rb.velocity.x, jump));
isJumping = true;
}
}
private void OnCollisionEnter2D(Collision2D other)
{
if (other.gameObject.CompareTag("Ground"))
{
isJumping = false;
}
}
private void OnCollisionExit2D(Collision2D other)
{
if (other.gameObject.CompareTag("Ground"))
{
isJumping = true;
}
}
}
SIR, HOW CAN I JUMP FROM LEVEL 2 TO LEVEL 3
----I DID TRY TO CHANGE IN FINISHLINE BUT WHEN I CHANGE LEVEL 2 INTO LEVEL 3, IT DIRECTLY JUMPS FROM LEVEL 1 TO LEVEL 3????
------PARDON MY GRAMMER...
You have a FinishLine Script in the "Level1" and "Level2" Scenes right? On the Script for "Level1" you set "SceneManager.LoadScene(...)" to "Level2", then change the Script for the "Level2"-Scene to "SceneManager.LoadScene(...)" to "Level3". Adjust names to whatever your Level-Scenes are named.
@@SergeantSam3D do you have any idea why when the player attached to death and respawn the player is disappeared but the camera still moving
just, relax!
Please help! I'm currently stuck on the Scene loading part as it won't let me start my game as an error keeps showing saying "The name 'Level2' doesn't exist in this current context". How can I fix this?
When i type Rigidbody2D it's not getting highlighted as your's, pls respond.
Vector2 is not getting highlighted either.
The variables didn't show up in the PlayerMovement Component..
This video is great!! But for some reason I cant get the player to move, even after i typed in the script and connected it to the player, the gravity does not even work
Do you have a rigid body 2d on it?
@@tombrandis because it sould work if you do