Тёмный

Unity 2D Player Move and Jump with Groundcheck Tutorial 

MoreBBlakeyyy
Подписаться 7 тыс.
Просмотров 46 тыс.
50% 1

More videos coming soon!
Intro 00:00
Setup 00:22
Creating Variables 03:12
Move function 03:58
Jump function 05:56
Inspector 06:33
Ground Check 07:20
Outro 10:44
Main Channel: / bblakeyyy
Patreon with fully explained c# scripts:
/ blakeygames
NEW SERVER LINK: / discord
Silhouette Dash free download:
blakey-games.itch.io/silhouet...
Join the discord community!:
/ discord
Play my games! :
blakey-games.itch.io/
play.google.com/store/apps/de...
Watch me Live on twitch: / bblakeyyy
My Website!: bblakeygames.wixsite.com/blak... Audio used in my videos:
♪ Onion (Prod. by Lukrembo)
Link : • (no copyright music) l...
♪ Branch (Prod. by Lukrembo)
Link : • (no copyright music) c...
♪ Biscuit (Prod. by Lukrembo)
Link : • (no copyright music) l...
♪ Bread (Prod. by Lukrembo)
Link : • (no copyright music) j...

Игры

Опубликовано:

 

25 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 164   
@sleepyboi5739
@sleepyboi5739 Год назад
Bepedi bopity . Your code is now my property
@GaganKumar-fz6wz
@GaganKumar-fz6wz Год назад
Thank you so much, I spent my too much time to following lots tutorials but no one works. This tutorial helped me.
@apcrothon6047
@apcrothon6047 Год назад
Thank you very much for this tutorial. Especially how you explain why you had done certain actions and ext. Many videos just click and do things without much explanation as to the why. Helped very much!!!!!
@Boogie-wi7hd
@Boogie-wi7hd Год назад
Most of the simple tutorials don't work so I had low expectation for this one but it works!!! Thank you for the video and thanks for not click baiting
@foros9548
@foros9548 10 месяцев назад
Finally a simple and good way to check for ground thanks for the help mate
@DougBoy791
@DougBoy791 6 месяцев назад
Best 2d movement tutorial i've seen i've been around a lot and they're all complicated but this on is short and to the point
@draftdimension9079
@draftdimension9079 Год назад
Thanks I have been trying to figure this out for at least three days.
@glowingshard-bfdi
@glowingshard-bfdi 3 месяца назад
tysm for this tutorial, in december i wanted to make a 2d platformer but i didnt know how to start, this tutorial helped me build the base of the game and im still developing it to this day and learning how unity works
@Real_Wollus
@Real_Wollus Месяц назад
Thank you so much❤ it took me 6 hours to find a working tutorial xD
@ITYWTD_
@ITYWTD_ Месяц назад
Thanks dude, learning C# and unity right now and this taught me a lot of features in unity I had no Idea about, saved me a lot of time from looking through unity’s documentation lol
@painithin
@painithin 7 месяцев назад
Very well shown and explained 👍🏽
@mrdragon7769
@mrdragon7769 11 месяцев назад
When I tried your method for the first time the jump didn't work. But now after adding the jump power up to 200 it worked. Thank you!
@griff424
@griff424 10 месяцев назад
SAME but ground check does not working still
@altertonart1085
@altertonart1085 2 месяца назад
late to viewing, but love how you explain what the code does and is easy to follow!
@matthewwilliamsvideos
@matthewwilliamsvideos Месяц назад
Thank you soooooo much for this you have no idea the trouble it saved me
@RavDeBest
@RavDeBest 10 месяцев назад
Thank god, I found this video. Every time I try the player can jump midair when I use tilemaps. Now when I try this method it worked. He isn't jumping in the air anymore.
@donalbrennan7289
@donalbrennan7289 Год назад
only tutorial i found that actually explains the code you're writing and how it works n stuff - thank u !!
@senecatheweeb1604
@senecatheweeb1604 3 месяца назад
Thank You!!!!!!!!!!!!! this vid means more than you'll ever know
@editsforevery1
@editsforevery1 3 месяца назад
thank you bro, amazing!
@atonyrodelo
@atonyrodelo 9 месяцев назад
yoooo thank you so much i fucken love I've been trying to figure this out for a long time i watched your video did exactly what u said and it fucken worked I'm understanding the concepts a little I didn't want to dopy and paste the code I watched and listened thank you so much....again thank you sooo much you didn't ask to join a discord or ask for money yours actually passing down knowledge thank you
@tbl7608
@tbl7608 Год назад
yay, it worked If you are having problem with the player moving, try to make the Move float public and add some number to it :)
@morebblakeyyy
@morebblakeyyy Год назад
You’re move float is accessed by your input every frame, so I don’t think this will make a difference, you likely did something else that fixed whatever issue you was having :D
@pirateninjagamer1684
@pirateninjagamer1684 17 дней назад
@@morebblakeyyyafter I’m done coding and in scene and have my player selected on the inspector panel on player Movement Script than there’s something that says IS JUMPING when I press play and jump than a check mark appears on the box and I can’t jump again How do I fix this???
@coolname2709
@coolname2709 Год назад
finally i found a good tutorial
@BabuWasHere
@BabuWasHere 7 месяцев назад
very helpful 👍
@NatronBlood
@NatronBlood 2 года назад
knowledge rules everything around me!
@tiemlee723
@tiemlee723 Год назад
Thank you so much because it working
@Osoclevergames
@Osoclevergames 2 месяца назад
Your awesome thank you
@FoodNomsNoms
@FoodNomsNoms 2 года назад
thank you so much. this helped me out so much. im trying to learn unity myself. but this isnt information overload and easy to understand. thank you man
@neozoid7009
@neozoid7009 Год назад
Awesome , But why did you suggested to use raycast for a long term project ?
@EdosBlu
@EdosBlu 3 дня назад
thanks soo much
@aenathemas9596
@aenathemas9596 Год назад
Great!!
@anjaneshpal8825
@anjaneshpal8825 8 месяцев назад
thank you
@sumdeathjr
@sumdeathjr Год назад
error CS0246: The type or namespace name 'RigidBody' could not be found (are you missing a using directive or an assembly reference?)
@145Jamie
@145Jamie 9 месяцев назад
How do you set up your Intellisense like that, mine isn't that suggestive
@justusisbestest4122
@justusisbestest4122 2 года назад
thank you so much!!!!!
@yahyagd5637
@yahyagd5637 Месяц назад
Is there a way where I can make it so if you hold before reaching the ground,your jump is still registered as soon as you reach the ground
@joaoi.9920
@joaoi.9920 Месяц назад
You re the best
@yoav_tc
@yoav_tc 2 года назад
Thanks! Works in 2022, helped me a lot!
@morebblakeyyy
@morebblakeyyy 2 года назад
Glad to hear it! :)
@69420bet
@69420bet Год назад
why i get an error. 'Collision2D' does not contain a definition for 'gameOpject' and no accessible extension method 'gameOpject' accepting a first argument of type 'Collision2D' could be found.
@toonztheunknown6164
@toonztheunknown6164 Год назад
what should I do if the console says ArgumentException : input axis horizontal is not setup. after the first set of code
@Wesleygoodboy
@Wesleygoodboy Год назад
What is the version of your Microsoft visual studio?
@sonny_days2751
@sonny_days2751 11 месяцев назад
I set up all the code correctly but it won’t move left and right when I press the keys and it won’t give me any errors
@wasabihulk4731
@wasabihulk4731 2 года назад
it says the name other does not exist in this context how do i fix it?
@csabaszabo2189
@csabaszabo2189 11 месяцев назад
Thx bro! Can you show the "flip" method to?:D
@oivariini7
@oivariini7 Год назад
Thanks for the tutorial, movement worked well but there is one problem that I can't fix. If I am touching a platform with the "floor" tag and then stop touching it but still am on the ground, I cannot jump anymore since I stopped colliding with a "Floor". Do you have a way to fix this?
@oliviercote9360
@oliviercote9360 Год назад
yes me to
@srogue112
@srogue112 11 месяцев назад
Works great! One question I do have is that for the jump, is there a reason you would choose to code the isJumping functions rather than just checking to see if rb.velocity.y == 0?
@JakeSimmer
@JakeSimmer 11 месяцев назад
Interesting question, I think Yes! There is always another way of doing things. Have you tried it? On another note, I didn't understand why we use 'oncollisionenter' and 'oncollisionexit' , my feeling is that can be simplified... Great vid tho! ;-)
@thenacho6354
@thenacho6354 Месяц назад
This wouldn't work on slopes
@bumberto_eko1068
@bumberto_eko1068 2 года назад
my cube is just going right cool
@guyturtle8927
@guyturtle8927 6 месяцев назад
Hey i tried everything but the jump didn't work can someone help me please? :(
@Jihmark
@Jihmark Год назад
Thank you for this tutorial. But what if I want to implement a double jump function?
@averageviewer8511
@averageviewer8511 7 месяцев назад
Sorry for being late, you'd basically have to make it so doing your Jump function is tied to a condition testing whether a variable (jumpAmount) is > 0, with the jumpAmount being reset upon colliding with ground (setting it to something like maxJumps) and just making jumpAmount count down 1 everytime you run Jump. Should be foolproof as you're always expecting Jump to have some kind of Y effect, so there'll always be an OnCollisionEnter with ground to reset Jump else but you could tie the jumpAmount refreshing to always reset on a timer when a boolean is set to true OnCollisionEnter, which is then set to false when exitting, with this being if you REALLY want to make sure nothing goes wrong (aka if you make a perfect container that makes a jump yet doesn't exit collision).
@coonstar
@coonstar 10 месяцев назад
It says the modifier private is not valid for the item? Please help
@BassJunkeeZ
@BassJunkeeZ Год назад
thanks
@bazzer360
@bazzer360 2 года назад
Saving this one for a future project
@morebblakeyyy
@morebblakeyyy 2 года назад
Glad to hear it!
@betsydillard3857
@betsydillard3857 2 года назад
I like the chapters!
@ekoproductions.1949
@ekoproductions.1949 Год назад
help please Script error: OnCollisionExit2D This message parameter has to be of type: Collision2D
@AmogusSussy69
@AmogusSussy69 11 месяцев назад
how to make a double jump function pls answer :D
@mechxp2008
@mechxp2008 Год назад
character speed, jump and rb is not showing up for me
@DeadlyInsaan
@DeadlyInsaan 2 года назад
Thanks!
@fglobal853
@fglobal853 11 месяцев назад
Thank you very much! Can you please add crouch to that code please?
@MusicMagic700
@MusicMagic700 2 года назад
Keep going , and thank you 😊
@morebblakeyyy
@morebblakeyyy 2 года назад
you're welcome :)
@isimsizanimator1291
@isimsizanimator1291 Год назад
i just want double jump how can i do this
@smucsaurzs
@smucsaurzs 3 месяца назад
the script things that show under it dont show for me
@bogm5801
@bogm5801 Год назад
I have a problem, my Variables aren't showing up in Unity even though I save and I get, Assets\PlayerMovement.cs(24,63): error CS1002: ; expected
@grasmously9610
@grasmously9610 6 месяцев назад
you probably forgot a ";" at the end of the line
@pffguy133
@pffguy133 Год назад
The ground doesn’t work there are no errors and the code is the same pls help
@swasdefguv
@swasdefguv Год назад
hey im getting stuck on the jumping code unity keeps giving me an error that says Assets\PlayerMovement.cs(30,7): error CS1513: } expected ive been trying to fix it for hours do you know what this means
@bblakeyyy
@bblakeyyy Год назад
You’re missing a } on line 30
@swasdefguv
@swasdefguv Год назад
@@bblakeyyy thanks
@progaming915
@progaming915 Год назад
what language do u use for the programming?
@guyturtle8927
@guyturtle8927 6 месяцев назад
C#
@Raptishy
@Raptishy 2 года назад
I just go straight up
@sachinkankane9877
@sachinkankane9877 2 года назад
Thanku so much bro ❤️❤️
@morebblakeyyy
@morebblakeyyy 2 года назад
No prob bro👌🏻
@PawelHerok
@PawelHerok 2 года назад
Thank you Very cool :)
@morebblakeyyy
@morebblakeyyy 2 года назад
Make sure to sub :)
@lehmspielt
@lehmspielt Год назад
Hey blakey i just have a question. when i change the square placeholder to my player sprite i could still walk but i wasnt able to jump anymore. I was still able to walk but jumping wasnt possible anymore. I didnt change anything other then the collider if you could help me out it would be appreciated!
@OmenRant
@OmenRant Год назад
according to the code, you have to change the speed and the jump after you start the game because it set the jump value to the 0. private void Start() { speed = 5f; //you can change this value jump = 200; //you can change this value. } try adding this code into the movement script. Edit : Sorry if its too late to answer I just wanted you to know this xd
@lehmspielt
@lehmspielt Год назад
@@OmenRant thanks!
@TypekMD
@TypekMD 7 месяцев назад
I doesnt show the variables in unity
@tesfalemgaming
@tesfalemgaming Год назад
the error says that it does not know what jump button is so im stuck can you help me plz also thanks for the video, it helpt other then the jump button.
@reliction
@reliction Год назад
instead of Input.GetButtonDown("Jump") use Input.GetKeyDown(KeyCode.W) where KeyCode is the button you want to use to jump
@nhatlinhphan4485
@nhatlinhphan4485 Месяц назад
i have the same thing the movement is working but the jump doesnt
@snabee5290
@snabee5290 Год назад
what a real babe
@xelber2935
@xelber2935 2 года назад
When i type " Rigidbody2d" nothing shows up what should i do to fix that because every soliution i try dosent work.
@capncrunchfan255
@capncrunchfan255 2 года назад
There is a space between Rigid Body and 2d. Try searching "rigidbody 2d".
@xelber2935
@xelber2935 2 года назад
@@capncrunchfan255 i tryed that but it didnt help but it worked anyways but thanks for the suggestion
@musakeys5600
@musakeys5600 2 года назад
It's intellisence follow my tutorial to fix it
@yungjetskimihara2
@yungjetskimihara2 2 года назад
Sorry but when i type my code, it doesnt come with the word colours and everything is perfect but it doesnt show the speed, jump functions in unity
@kingdoom1906
@kingdoom1906 2 года назад
You fix it or not because i know why that’s happening
@yungjetskimihara2
@yungjetskimihara2 2 года назад
@@kingdoom1906 nope
@gachastorys5129
@gachastorys5129 Год назад
@@yungjetskimihara2 it might be an intellisense problem. Are you using visual studio?
@t.b.g158
@t.b.g158 2 года назад
If "Input.GetAxis("Horizontal");" is the old method what is the new one?
@morebblakeyyy
@morebblakeyyy 2 года назад
It’s a whole new input system. I’m gonna do a video on it, as it’s a bit of a pain
@t.b.g158
@t.b.g158 2 года назад
@@morebblakeyyy Thank you so much for the help though i haven't found anyone as simple as you...the only problem that you have is not having enough tutorials in your channel😂 I Have Subbed already so i will be waiting for you mate
@morebblakeyyy
@morebblakeyyy 2 года назад
@@t.b.g158 no prob man! Appreciate that👌🏻
@Padrrigg
@Padrrigg Год назад
I don't understand the 4:52 part
@Dagoldenaxolottl7808
@Dagoldenaxolottl7808 7 месяцев назад
every time i try this, it just says'arguament Exception: input jump buttton is not setup'
@guyturtle8927
@guyturtle8927 6 месяцев назад
You have to rite Jump Not jump
@Fredrick-Gregory
@Fredrick-Gregory 2 года назад
It keeps coming up with the error Assets\Scripts\PlayerMovement.cs(25,63): error CS1002: ; expected What do I do This is just for the movement script btw
@morebblakeyyy
@morebblakeyyy 2 года назад
Means ur missing a ; or it’s in the wrong place
@Wolphen
@Wolphen 2 года назад
Did you fix this yet, as I am having the same problem and my script is identical to that of the video...
@morebblakeyyy
@morebblakeyyy 2 года назад
@@Wolphen if you’re having that error it’s not identical, you’re missing a semi colon
@Wolphen
@Wolphen 2 года назад
@@morebblakeyyy Hey tysm for the quick reply - i found out it was actually just the lack of a capital S in a variable, so i corrected that and boom - fixed :D
@morebblakeyyy
@morebblakeyyy 2 года назад
@@Wolphen good stuff, make sure to sub!
@forrester659
@forrester659 11 месяцев назад
ARAZI OLSUN
@forrester659
@forrester659 11 месяцев назад
razı*
@xDTHECHEMISTx
@xDTHECHEMISTx 2 года назад
will you create a tutorial for 2Dcharacter attacks?
@morebblakeyyy
@morebblakeyyy 2 года назад
Yeah sure
@oscardog2342
@oscardog2342 2 года назад
this and evey other unity 2d tutorial movement tutorial dosent work for me
@daffadziibaankhoiri1176
@daffadziibaankhoiri1176 Год назад
what is key for jump?
@nhatlinhphan4485
@nhatlinhphan4485 Месяц назад
i think space?
@alikaiyr6308
@alikaiyr6308 11 месяцев назад
rakhmet man
@anasfaidhy5674
@anasfaidhy5674 2 года назад
how to fix (51,2): error CS1513: } expected
@musakeys5600
@musakeys5600 2 года назад
Send screenshots
@DerriousDancer
@DerriousDancer 7 месяцев назад
This didn't work I need help
@loboleigh7337
@loboleigh7337 2 года назад
its not working bc player movement speed jump wont show up :(
@user-gs3wo3oz2q
@user-gs3wo3oz2q Год назад
mee too
@highonowlmoist409
@highonowlmoist409 Год назад
i dont have the same in my unity promaiters help plz. 5:25
@manangrover2086
@manangrover2086 2 месяца назад
its been 9 months found any fix to it ?
@foxheals
@foxheals 2 года назад
On collision seems more robust bc you can technically touch terrain where you aren't raycasting. Bc of this I always end up making like 8 raycasts around my player. Why isn't On Collision as good?
@morebblakeyyy
@morebblakeyyy 2 года назад
On collision works great, raycast is just more reliable when you only want to target the floor below you or a specific angle. It’s whatever works better for your game!
@foxheals
@foxheals 2 года назад
@@morebblakeyyy ok thanks
@TheGuyInTheHoddie
@TheGuyInTheHoddie 2 года назад
um i try doing the tutorial 10 time and it is not working
@morebblakeyyy
@morebblakeyyy 2 года назад
whats wrong with it?
@TheGuyInTheHoddie
@TheGuyInTheHoddie 2 года назад
@@morebblakeyyy it keeps glitches and it would sometimes say it doesn’t have a class or error
@SubToPlunga
@SubToPlunga Год назад
your second channel has more subs than ur main
@morebblakeyyy
@morebblakeyyy Год назад
Indeed. Tutorials naturally do better then game development challenges and stuff so was planned.
@orionB08
@orionB08 2 года назад
The code is working pretty well but the 'Is Jumping' gets a tick automatically how can i fix it?
@musakeys5600
@musakeys5600 2 года назад
Follow my tutorial
@rashedalqarni118
@rashedalqarni118 2 года назад
Is there code i can make it flip each side? Please
@musakeys5600
@musakeys5600 2 года назад
Follow my tutorial
@LForce5241
@LForce5241 9 месяцев назад
I did everything you said but it does not work I don’t get any errors idk if this is fake or not
@adrianmeyer2157
@adrianmeyer2157 2 года назад
Ah buzzin, it's mad how some of these problems are easy when shown how haha.
@morebblakeyyy
@morebblakeyyy 2 года назад
nice one
@nequick1462
@nequick1462 2 года назад
majka umrla
@brockkenney6428
@brockkenney6428 Год назад
I won't let me jump
@guyturtle8927
@guyturtle8927 6 месяцев назад
Same here
@roachdoggjr1940
@roachdoggjr1940 Год назад
what the fuck? why is my bool always set to false? did unity change something?
@briosh.mp4
@briosh.mp4 Год назад
this dont work
@ItsBrickzz
@ItsBrickzz 5 месяцев назад
Player movement doesn't work at all
@ITYWTD_
@ITYWTD_ Месяц назад
What’s not working?
@ItsBrickzz
@ItsBrickzz 29 дней назад
@@ITYWTD_ well that was a long time ago and from what i remember i abandoned that project but it was propably just my fault
@anti.zoo.soldier
@anti.zoo.soldier 6 месяцев назад
The stupid menu didn't show up so i cant make it function (but youre a pro its eazy af and you have money)
@morebblakeyyy
@morebblakeyyy 6 месяцев назад
What lol
@anti.zoo.soldier
@anti.zoo.soldier 6 месяцев назад
@@morebblakeyyy im sorry but my little brother tryed unity And He just raged So this happend
@CoolllamaTMM
@CoolllamaTMM Год назад
dosnt work
@bblakeyyy
@bblakeyyy Год назад
Does still work currently. Double check your code, editor setup, etc
@Jake7i
@Jake7i Год назад
@@bblakeyyy Cannot get it to work any longer either with newest Unity Update.
@bblakeyyy
@bblakeyyy Год назад
@@Jake7i What's your issue
@charlieslives
@charlieslives 2 года назад
You are amazing thank you very much
Далее
Unity 2D Smooth Camera Follow Tutorial
6:34
Просмотров 7 тыс.
Volkswagen судится с Volkswagen?
01:00
Просмотров 1,8 млн
MEGA BOXES ARE BACK!!!
08:53
Просмотров 32 млн
Idle, Run and Jump Animations - Platformer Unity 2D
10:13
How to jump in Unity (with or without physics)
16:09
Просмотров 40 тыс.
How I made an Excellent Platformer
8:25
Просмотров 256 тыс.
What does a Game Engine actually do?
16:45
Просмотров 140 тыс.
Optimizing my Game so it Runs on a Potato
19:02
Просмотров 434 тыс.
Unity Player Health and Health bar Tutorial
10:52
Просмотров 16 тыс.
ИГРОВОЙ АВТОМАТ !! КАБАНИМСЯ
2:47:17
УРА 🥳 ОБНОВА! ОТКРЫВАЕМ ЯЩИКИ!
3:19:40