Improve your Platformer’s Jump (and Wall Jump) | Unity

Improve your Platformer’s Jump (and Wall Jump) | Unity

Dawnosaur

1 год назад

110,323 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

guy who doesnt have name
guy who doesnt have name - 20.09.2023 19:11

HAWLLOW KNIFT?

Ответить
Ghost Phoenix
Ghost Phoenix - 12.09.2023 06:38

Great video, it's covers a lot, very nice! I do have a small issue though, where the player can jump infinitely. I'm trying to look through the code to see where the "double jump" is set so I can fix it so that I only jump 1-2 times, but I'm having a hard time. Can you help?

Ответить
Turbo 86
Turbo 86 - 02.08.2023 17:17

You do a great job at explaining things. If you could show some specifics of unity (such as showing the difference both visually and from the different cose value attached to it) think that will add more depth and understanding for the viewer.

Subbed. Keep up the good work 👍

Ответить
MoeLow
MoeLow - 01.08.2023 12:41

incredible video, I find myself coming back to it many times!
just wanted to ask how does the player data script work? is it a separate script referenced in the player controller with all the variables set to public?

Ответить
Bruce Lee
Bruce Lee - 28.07.2023 10:35

Anyone managed to implement this script into their own game? My player's x and y velocity keeps changing for some reason even though im not moving

Ответить
Jason Welch
Jason Welch - 22.07.2023 13:12

Thanks! I didn't know about the cayote time thing. Got that taken care of in a few minutes.

Ответить
Bruce Lee
Bruce Lee - 21.07.2023 13:13

Man great video but I feel like half frustrated? Sometimes things are said with code snippets and sometimes without. Like give me all or nothing man

Ответить
Jarusca
Jarusca - 09.07.2023 08:38

Man! Incredible research!

Ответить
Khang
Khang - 05.07.2023 13:00

xin code

Ответить
Loup&Snoop
Loup&Snoop - 03.07.2023 01:51

Nice video. I tried your code. Most of it works great, but I found a pretty major bug.
1) If ground hitbox doesn't cover whole player, you can be stuck jumpless on edges.
2) If ground hitbox is wider to cover floor, then you can clip into walls => normal jump on walls.
My solution was to make the ground hitbox wide, and make sure you are grounded for at least 3 physics frames in a row before attempting any normal jump. This way the physics engine has time to eject you from a wall.

Deets: I make a private int continuousGroundedFrames. In FixedUpdate, if grounded, continuousGroundedFrames++. In Update, only give coyote time if you've been grounded for 3 physics frames continuously. When jumping, set continuousGroundedFrames to 0. To walljump condition, add "and not grounded" to prevent jumpbuffer from giving walljumps on floor.
I know it's been a while, but I hope this helps. Cheers.

Ответить
BABA
BABA - 01.07.2023 04:21

Incredible video 🙏🙏🙏

Ответить
Joe Morris
Joe Morris - 27.06.2023 05:29

This video series was super helpful in making my group project for school feel a 1000 times better! The logic for accel and deccel is genius, and making the gravity scale higher only when falling made a huge impact. Thanks!

Ответить
brutexx
brutexx - 26.06.2023 05:22

Thank you for these videos. You are awesome, man.

Ответить
Emerald Cube Gaming
Emerald Cube Gaming - 24.06.2023 03:50

All of your videos are amazing, and I appreciate your work as well as the fact that it's free. However, I wanted to ask something. When adding your double jump code to your given Player Movement script, I got four compiler errors all relating to the same thing; the variables weren't given any definition / they don't exist. I assume there's is an easy fix but since I'm pretty new to game making, I don't know what to do. Can you help me on this one? Much appreciated @DawnosaurDev

Ответить
Kebxai Aod
Kebxai Aod - 14.06.2023 15:05

Hello, i don't know how to implement player animations in this script. Can you say where i put the animator variables, how to check if player is moving and etc?

Ответить
Paruthi.618
Paruthi.618 - 11.06.2023 07:51

awesome video, thanks

Ответить
Kardok Delikaya
Kardok Delikaya - 02.05.2023 13:10

Do you plan to make a video about moving platforms?

Ответить
Shinos
Shinos - 16.04.2023 15:41

Your videos helped me so much, this is a smack to the face to all the people saying that you cannot build a nice platformer controller with built-in physics, this is excellent.
PS: did you manage to get slopes working right too?

Ответить
Drakkith
Drakkith - 16.04.2023 14:03

Quick and easy to grasp the ideas without getting bogged down with code. Great vid!

Ответить
Sabine Kine
Sabine Kine - 08.04.2023 05:01

I'd be really interested in a Udemy course or something, where you actually set up a player controller from start to finish. I'm very new to Unity and a lot of things throw me off as a I try and follow along bit by bit here. I don't really want to just paste code I don't understand and copy your file wholesale, though. I got into Unity following a Metroidvania course by, I think their channel is GamesPlusJames? The movement controller for that was very simple and I'm seeking physics and movement more similar to a game like Rain World and by far youre the most in-depth out there but maybe too capable and experienced for a beginner to follow. Things like Data.gravityscale simply don't work in my Unity and I assume it is because you're referencing a separate data file, but I'm unfamiliar with setting that kind of thing up when plugging into my game. A full in-depth tutorial might be time costly, but I'd certainly be willing to pay for a full understanding of how you would set up the platformer start-to-finish and to understand all of the code, not just snippets.

Ответить
Jake the Jay
Jake the Jay - 08.04.2023 00:55

My jump doesn't work for some reason. The key detection works but the jump function doesn't seem to be called when I press the button. I triple checked to make sure my code was exactly the same and I am just confused as to how this is happening.

Ответить
Kalila Workman
Kalila Workman - 31.03.2023 02:57

I appreciate your code comments so much thank you! They are so helpful! Awesome job on the code and the video!

Ответить
radio muranatsu
radio muranatsu - 21.03.2023 18:27

Thanks for sharing! Amazing!

Ответить
Darwisy Baqir
Darwisy Baqir - 17.03.2023 20:07

question, i might've missed this when watching the video, but what is the code format for the script you shown in the video?
python or C#???

Ответить
GebakkeSushi
GebakkeSushi - 15.03.2023 18:15

Can someone help me? I downloaded the scripts and imported it to my scene and i copied the celeste example to see how it feels and to change it from that, but my character doesn't move or fall or anything. How can i fix it?
Update: My player now moves but it falls over everytime and i cant jump before falling over

Ответить
TheFunnyBuddy
TheFunnyBuddy - 12.03.2023 20:41

One thing I've noticed is when you have a double jump and jump buffer, you could end up using a double jump instead of a jump buffer. Once you're airborne you'll try to double jump but can't since you technically already used it.

Ответить
miserable little pile of secrets
miserable little pile of secrets - 04.03.2023 10:27

This is crazy good. Very meticulously analyzed and applied, with expertly clear explanation!

Ответить
den
den - 25.02.2023 16:58

Yo this video is great!! There's so many good info

Ответить
WafflyDig
WafflyDig - 22.02.2023 08:40

Hi Dawn thank you so much for the code and tutorial very informative!

Is there any chance you could show/tell where in the code to switch animation parameters set up in the animator? I think a simple idle, run, jump and fall would do a lot of people wonders.

In my case I have an idle and jump parameter setup correctly but am having problems getting a "running" boolean to turn to true while on ground. (Strangely it seems to work after a jump though).

Regardless thank you so much for the hard work you clearly put into this

Ответить
Роман Вівтович
Роман Вівтович - 31.01.2023 21:33

Very informative!

Ответить
lizard LTD
lizard LTD - 29.01.2023 02:00

The hades ost in the background is so fun lol
You made this video very well, it's clear and fun to watch!

Ответить
Alice Giraud
Alice Giraud - 20.01.2023 02:52

Wow this is an incredibly impressive and useful work! Just when I was about to abandon making a decent wall jump for my first game. Thanks a lot! Subbed and eager to watch all of your other videos, you really made my day! :)

Ответить
Trip
Trip - 09.01.2023 09:18

Just something I've been thinking about, is it common to see games use an equivalent of coyote time and jump buffering for wall jumps? I'm thinking of something like a situation where you bounce off of two closely spaced walls to scale a narrow passage. Coyote time seems like it would give the player a short grace period if they fall off the wall to make the jump to the opposite wall. Buffering doesn't seem like it would be as useful because I can't recall any games where you'd get penalized for hitting the jump button too early in that situation, but it still might come up.

Ответить
loop
loop - 04.01.2023 05:41

can you do soundtrack next?

Ответить
Hyper
Hyper - 21.12.2022 17:32

really underrated content, glad i found this rare gem :)

Ответить
D MAS
D MAS - 09.12.2022 23:08

uses old input manager, trash /s

tried the demo but i found you could jump in the Super Meat Boy by pressing jump before landing, however, if i released the button before landing as well, i would get a full jump, and a rewrite using the new input system would be better

Ответить
Alan Brandan
Alan Brandan - 06.12.2022 22:20

great tutorial!

Ответить
Itay MadeIt
Itay MadeIt - 02.12.2022 15:14

Great Video!

Ответить
zorro infernal
zorro infernal - 01.12.2022 20:56

you have video of dash in games?

Ответить
MinouPitou
MinouPitou - 30.11.2022 07:44

i've watch the first video of the series, and it greatly helped me understand how physics in unity works (and that i don't need kinematics physics to achieve a great player movement) I wanted to point out that your analysis are great, you know what you are talking about. I want to give you kudos for the wall jump approach. every time i want to make a walljump in a game i fall in a great depression cause it is so frustrating to get it right... i always choose to disable horizontal movement when doing a wall jump, never thought of just tweaking the player horizontal input speed. thanks for sharing all of these. every tips you give gets me more motivation to actually finish my celeste rip off! it sounds stupid, but great and smooth controls comes with lots of easy and small tweaks, and you pointed out a lot of them in your series. Thanks again Dawnosaur! i should have sub way earlier. wish you success in all your project!

Ответить
Dani Inkidar
Dani Inkidar - 30.11.2022 05:44

More videos like this and the channel will boom I promise.

Ответить
Xion Brown
Xion Brown - 28.11.2022 03:17

This video was exactly what I was looking for, thank you!!

Ответить
Rotaka
Rotaka - 27.11.2022 00:12

It’s incredible the amount of techniques used to make a platformer fun to control, awesome video ! Adding the code examples was a great idea as well!

Ответить