Unity 2D Platformer for Complete Beginners - #3 WALL JUMPING

preview_player
Показать описание
In this video we're gonna implement wall jumping for our 2D platformer.

#pandemonium #unity2dplatformer #unitycompletebeginner

Tags: Unity 2D Platformer for Complete Beginners,platformer for complete beginners,unity wall jump,unity wall jumping,wall jumping,wall jumping platformer,Unity 2D Platformer episode 3,unity platformer wall jumping,unity wall jump 2d,unity platformer wall jump,unity how to wall jump,Unity 2D Platformer for Complete Beginners - #3 WALL JUMPING,unity 2d platformer wall jumping,unity 2d platformer wall jump,game development wall jumping,unity 2d game wall jump,unity c#

0:00 Intro
0:05 Cleaning up the code
0:51 Raycast & boxcast
3:10 Implementing boxcasting
4:10 Layers & layerMasks
6:35 Detecting wall collision
8:45 Sticking to walls
10:40 Climbing walls
15:21 Jumping Away from the wall
16:56 Final Result & Outro
Рекомендации по теме
Комментарии
Автор

FAQ:
1. I don't recommend skipping this episode, there's some code here that we are going to use later on. If you don't want wall climbing just don't mark any objects with the Wall layer.

PandemoniumGameDev
Автор

One of the better tutorials on Youtube! While other youtubers just type code and expect you to already understand what it does, Pandemonium actually explains in detail each and every line of code!

benchew
Автор

I swear this is literally the only thing i've needed so far, i've tried tutorials in the past, however i found they never worked, or were very unoptimized. This tutorial is god tier.

astronautboi
Автор

If your player is only moving up the wall instead of jumping off of it, remove this line in your update function:
body.velocity = new Vector2(horizontalInput * speed, body.velocity.y);
At 0:10 it's line 19 in the video

hellsgate
Автор

even though I don't plan on adding wall jumping to my game, this is still, by far the best player movement tutorial I've seen!

thenacho
Автор

I'm really glad I kept a backup of my code before starting this. I don't want wall jumping, but figured "I'll follow this for the new jump method, and just get rid of the wall jumping later". The only thing I managed to do was make my jumping worse and break the animation. I even downloaded his code file and copied it into my game. Same thing. I don't know how I messed it up. I know I did a few things differently cause I knew easier ways from other tutorials (like just using "public" instead of "serialized field") The only thing I actually need is a way to stop sticking to walls (I was sticking to walls by just moving sideways and colliding with them in midair) before doing this tutorial.

tonyaldrich
Автор

Now I found Tube's best tutorial. In the first episode, the texts that really came in handy. There has been insane work in them. Pandemoniun has given his all to the free side. All the other professionals at Tube have deliberately made mistakes that are capable of selling a $ 1, 000 package, that is a robbery. I have been trying for seven months to get one tutorial to the finish. I've always been stuck. I got stuck in this tutorial 3 because I got some problem with [serializ ...]. I copied the code that Pandemonium had shared with us and got to continue again. This will be the first tutorial I will complete and I will give the Pandemonium an award. Thank you for a very good job. I wish there were more like you.

jjkilpi
Автор

I was also wondering why the wall jump isn't working if the statement :
body.velocity = new Vector2 (horizontalInput*speed, body.velocity.y);
is after the if() for jumping [still inside the big if (wallJumpCoolDown > 0.2f) ]
The changes happen around 11:20. Thank you again for the tutorial, I'm glad to be able to learn with you !!

ratala
Автор

THANK GOD U PUT THE 3 EPISODE FULL THING IN THE DESC CUZ MY UNITY CRASHED AND ALL OF MY WORK GOT LOST

TheBighi
Автор

For anyone that doesn't want to have to change the gravity scale in both the code and the editor when the player leaves the wall.

- Create a float variable called initialGravity (or anything you like)
- In the awake, set initialGravity = body.gravityScale
- Set the gravity in the else statement, when you de-attach from the wall, to the variable initialGravity
:)

DarkLynxDEV
Автор

Great stuff man. Thank you for delivering great content. Really to the point and your explanations are super helpful.

Davieu
Автор

Great video. I had an issue where my player was flying and posted a comment here, but editing it to say that I somehow missed that the isGrounded should get the `collider` property and check for null, not the raycastHit itself.

soularpowergaming
Автор

Solution for people who don't want wall jumping: For anybody having issues with buggy wall jumping: The character's hitbox sometimes gets confused I think and you can wall jump just by touching a surface. The easiest way to fix this is to change the "isGrounded" function from checking using raycasting to checking using Y velocity. Inside the isGrounded function, replace all the code with this:

if (body.velocity.y == 0)
return true;
else
return false;

That allows the player to ONLY jump when they aren't falling.

heypikachu
Автор

how the hell you have so few subscribers? This is the best tutorial about 2d platformers i have seen so far and i i have checked a lot of them including unity's official courses, Brackeys, Code Monkey etc.

Geckotr
Автор

Keep doing what ur doing my dude! the grind will pay off

hisyamhasbi
Автор

the quality of these vids is amazing! u put so much effort in this tutorial for FREEE! thx bro

dany-ce
Автор

This is a great tutorial! I made it all the way so far, and I'm even at the point where I'm changing some things to see what I like (a good way to tell if you understand).

naejimba
Автор

I really enjoy the series and its very helpful. I can't wait for the 4th episode.

kiflisajtos
Автор

this guy needs more views and his channel is very underrated :)

chartom
Автор

Just found your Unity 2D videos. Super informative series, thank you!

jaredbush