🎬Just launched the Sequel: kzbin.info/www/bejne/gXyqlXd4e8ioZrM Discord: discord.gg/W5vE5WKXYH Try out the examples: dawnosaur.itch.io/platformer-examples
@SlytheBat Жыл бұрын
WTF That reply was so fast!!!
@hamzabeg68822 жыл бұрын
this is, quite literally, EXACTLY what I was looking for. I wanted to make Celeste-esque physics and didn't even have to search specifically for Celeste to find this.
@DawnosaurDev2 жыл бұрын
Happy it helped!
@Verdal_JG2 жыл бұрын
Maddy has made a post on medium about how celeste physics works. It does not work using forces. It uses speed/velocity vectors to calculate movement and exact positions on a tilemap (due to it being pixel art, madeline cannot move half a pixel etc), obviously its a lot more complex than that, but I can confirm it does not use forces as such. The concept is the same however, you do want acceleration and deceleration, but you can achieve it without forces.
@beri4138 Жыл бұрын
@@Verdal_JG Isn't it incorrect to say Madeline cannot move half a pixel? Since strats like ceiling pop rely on manipulating her subpixel position?
@Verdal_JG Жыл бұрын
@@beri4138 forgot to specify visually, obviously subpixels exist but visually the game only uses integer values
@beri4138 Жыл бұрын
@@Verdal_JG I didn't realize subpixels can exist visually
@MrCrompz7 ай бұрын
This is exactly what I needed! A video on advanced movement! I was having loads of issues previously, and this fixes them all! Thanks so much!
@Arcadendo3 жыл бұрын
Wow, even though I'm not a game dev, everything was so well explained and easy to understand. Also great editing ;).
@DawnosaurDev3 жыл бұрын
Fancy seeing you here
@Arcadendo3 жыл бұрын
@@DawnosaurDev ;)
@huseyinakkoc1062 Жыл бұрын
accelRate = (Mathf.Abs(targetSpeed) > 0.01f) ? acceleration : decceleration; what is that ? can you explain
@Nazadev Жыл бұрын
@@huseyinakkoc1062 The line of code in question is as follows: csharp copy code float accelRate = (Mathf.Abs(targetSpeed) > 0.01) ? acceleration : deceleration; This line of code is inside a FixedUpdate() function in Unity and is responsible for calculating the acceleration rate (accelRate) based on the target speed (targetSpeed), acceleration (acceleration) and deceleration (deceleration). Next, we will break down the line of code to understand how it works: Mathf.Abs(targetSpeed) > 0.01: This part of the code checks if the absolute value of targetSpeed is greater than 0.01. Mathf.Abs() is a static function of the Mathf class in Unity that returns the absolute value of a number. In this case, you are checking if the targetSpeed is greater than a minimum value of 0.01. This is used to determine if the object should speed up or slow down. ? acceleration : deceleration: This part of the code is a ternary operator that determines the value of accelRate based on the result of the previous condition. If Mathf.Abs(targetSpeed) > 0.01 is true, then accelRate will be equal to acceleration. Otherwise, accelRate will be equal to deceleration. In short, this line of code sets the acceleration rate (accelRate) based on the target speed (targetSpeed). If the target speed is greater than 0.01, the acceleration value is used. Otherwise, the deceleration value is used. Yeah I used ChatGPT
@ntu4093 жыл бұрын
I was looking for something like this for days. Really well-made video.
@Megahertzs3 жыл бұрын
Let me just say man, of all the player controllers I've implemented, when I finally got this working, it is by far the best feeling controller I've ever made. I'm more of a Visual Scripting guy so it took me a little time to translate your system here, but DUDE! Thank you so much! This is now going to be my designated method for player movement! You rock!
@DawnosaurDev3 жыл бұрын
Thanks so much, that means a lot. Glad it was helpful :D
@DonJulioGames2 жыл бұрын
would love to see the visual script version of this!
@perrylets Жыл бұрын
If you like visual scripting, what you can do is making modular c# code and make specific cisual editors for your use case (I know it's hard, but it's also weirdly fun)
@tylerweirtube Жыл бұрын
This is perfect. Working on my first game with my son. Our movement is big standard and feels awkward. Thank you so much!
@morososaas33972 жыл бұрын
2:07 the most beautiful 4 lines of code I have seen in my life
@DawnosaurDev2 жыл бұрын
Made me smile!
@vinhnguyen-o5z2 жыл бұрын
agreed
@Radek_M. Жыл бұрын
Well, I spent many hours looking for a good and also beginner-intermediate 2D platformer movement system for Unity and finally found this. Now this is a quality content. The video is easy to understand, and the used concepts are really well-explained. Provided github code is well documented and easy to understand with some Unity documentation digging, also great for adapting by using scriptable object for holding movement parameters. I hope you will put here more useful videos like this. :)
@floatixx2 жыл бұрын
Actually crazy how much information you put in this video while keeping it short AND understandable. Really really great video!
@huseyinakkoc1062 Жыл бұрын
"accelRate = (Mathf.Abs(targetSpeed) > 0.01f) ? acceleration : decceleration;" what is this can you pls explain ı did not get it
@mithatcanturan14522 жыл бұрын
Man, I've been using Unity for quite a long time this is literally the BEST video I've ever seen about platformer movement. Glad youtube showed this on my homepage.
@DawnosaurDev2 жыл бұрын
Wow, thanks so much! Happy it helped :D
@linzenmeyer3 жыл бұрын
Haven't looked at the code, but from the looks of the listed files, you are using the new Input System....thank god!
@DawnosaurDev3 жыл бұрын
The new input system's so cool! It's not super well implemented in the code right now, but when I get round to adding some new features, I'll try to tidy it all up and make it all fit nicely :D
@linzenmeyer3 жыл бұрын
@@DawnosaurDev and for those who had issues like me implementing the handler and control files and movement scripts, you will need to go into Edit-> Project Settings and then Player and scroll down to the configuration section and change Active Input Handling from New or Old into "Both" in order for the current code to work.
@ricniclas2 жыл бұрын
Your video is so good that I managed to use your solution for 3D, as well as adapt your code to have momentum like Sonic games!
@MasterDisaster64 Жыл бұрын
May I ask how you converted the Run method into 3D? I tried to, but it caused the character to accelerate exponentially out of control.
@gamedevshrish76022 жыл бұрын
This is very nice way of using RB but still respecting it's velocity variable by keeping it untouched.
@bendux3 жыл бұрын
Thank you!
@DawnosaurDev3 жыл бұрын
No thank You for watching :D
@zXMOSZXz3 жыл бұрын
This is amazing. Really hope you keep up with these. Great job!
@zaixrx3 жыл бұрын
Wow, I really like that, I've been looking for this video for a long time
@zaidmermam25243 жыл бұрын
finally a professional tutorial about unity player movement, thanks!
@kardokdelikaya9570 Жыл бұрын
Thanks a lot for this tutoriol. I tried so hard to make a good platformer movement and watch a lot of videos. Yours is the best.
@Uniquename12345a2 жыл бұрын
One of the highest Quailty gamedev tutorials i ever seen
@I-OGameDev2 жыл бұрын
This video is so high quality, excellent job! Looking forward to more
@bungercolumbus2 жыл бұрын
Really nice explained. Many people which program in unity do not realize how important all of these mechanics are and you really explained all. Edit: And the fact that you explained them IN CODE. Dude you need more subs.
@SlytheBat Жыл бұрын
I remembered seeing this video 2 times before, and I remembered it was so simple and informative. And today I am making my first game, and I wanted the controls to feel as good as possible, and then I remembered this video. I searched up something like "Video game movement analysis", and I found it!
@gameweavers8 ай бұрын
The same tutorials on KZbin are repeated over and over again, using the same methods, and 99% of them are very basic tutorials. Professional and high-quality tutorials like this are rare and must be supported.
@SrFatTabby2 жыл бұрын
Thank you, this made my platformer feel even better to play!
@daniinkidar992 жыл бұрын
Very well explained. Glad I found this
@ChequeEspeciaI2 жыл бұрын
FINALLY A GOOD VIDEO THAT SHOWS A DIFFERENT WAY TO MOVE, THANKS DUDE
@Ignaciodev6 ай бұрын
have had alot of probelms with movement fundamentals, thank you so much for this
@jankriveccvetkovic7672 жыл бұрын
Absolute S tier video. I was wondering why my movement felt so stiff and floaty and this improved it by sooo much
@darkjaslo2 жыл бұрын
Finally someone who truly explains how to make proper player movement instead of making something in 20 minutes and showcasing it! Great video, very useful
@moshavdough55302 жыл бұрын
had an absolute blast watching through this video for 3 days getting everything just right. Great video
@stocktonkaneko19912 жыл бұрын
This is the best Player Controller video I’ve seen. Thank you so much!
@gabdev28913 жыл бұрын
I'm from Brazil, and your video is very amazing, I hope it continues. Very good. ✔
@ShreddedNerd2 жыл бұрын
I'm having an issue with this where jumps kind of reset my acceleration, rather than carry over my momentum.
@CDMudd Жыл бұрын
This was SO HELPFUL!!! Thank you and please keep making more tutorials!
@HiHi-iu8gf2 жыл бұрын
yo this is a really nice solution; I've always had an issue with figuring out how to get physics-based movement to not feel so sluggish, and the scaling-force-by-difference-from-target-speed thing you have here seems to work pretty well
@lolgameking47842 жыл бұрын
The quality of the videos. The music and videogame taste. The smooth explaining. There's no reason NOT to be your 500th subscriber! :D Congratulations, underrated tutorial guy! And..well..thanks! XD
@DawnosaurDev2 жыл бұрын
🥳 Thanks so much! Super happy you enjoyed it, hope it was useful :D
@panttrans84482 жыл бұрын
Absolute pure jam, thank you for video!
@BABAPLAYTOOMUCH Жыл бұрын
Please keep making these types of videos they’re very useful 🙏🙏🙏
@abalorias3332 жыл бұрын
People don’t realise this video worth infinite. Its so good
@DawnosaurDev2 жыл бұрын
Thanks! That means a lot :D
@kristophsams50363 жыл бұрын
Very very informative. You've made me want to go back and re-adapt this to my own. Thank you.
@DawnosaurDev3 жыл бұрын
Thanks a lot, hope it helps!
@CodeWithKarl3 жыл бұрын
Damn i finally found what i was looking for. please keep up the good work!!!
@DawnosaurDev3 жыл бұрын
Happy it was helpful!
@aleksanderadamczyk65733 жыл бұрын
Great tutorial! There aren't many others that are targeted for upper beginner / intermediate creators! Keep them coming man!
@DawnosaurDev3 жыл бұрын
Thanks a lot! Yeah, i'm loving working on these style videos : D
@NotDominic263 жыл бұрын
Great video, I'm no game dev but I still feel like I learnt something - and the editing was really great too!
@DawnosaurDev3 жыл бұрын
Hey, you look familiar :D
@NotDominic263 жыл бұрын
@@DawnosaurDev 👀
@luther48543 жыл бұрын
Great video and of a higher quality than a lot of other Unity tutorials I've seen. Looking forward to your next video
@rainfraiser38453 жыл бұрын
This is explained so clearly, I couldn’t have done it better myself. Thank you! :D
@DawnosaurDev3 жыл бұрын
Glad it was helpful :D
@Cottoncriminal2 жыл бұрын
I just started developing and designing games 4 months ago, I'm about to tackle my first platformer in the next few weeks as my next project. This is explained so well and i understood 100% of it! I'm so proud to be able to look at the code now and understand what it means and I'm so happy to be at a point where if i do end up copying this code, it wont be blindly copy pasting it. I'm still not at the point where i can come up with things like this myself but i can definitely tweak a few things and understand the effect they have and my reasoning for them. Thank you for making this video! i subbed and I'm looking forward to watching many more of your future videos :)
@DawnosaurDev2 жыл бұрын
That's so awesome! Really lovely to hear, hope you have a blast making your platformer :D
@sp_stephen7 ай бұрын
This needs to be said right now... This is the best video ever made on youtube, it is so helpfull and so full of information, i would pay money for this information, because im in need of movement system for my 2D Metroidvania
@hardwinwelly2486 Жыл бұрын
a year late, but howly this is EXACTLY what i need. I want to make a snappy movement but I want it to still able to be affected by AddForce. Thanks a lot dude you just gained a subs!!!!
@joneyor65952 жыл бұрын
Quickly and well explained :D i just need to understand it now xD
@rapasdecoeur70172 жыл бұрын
Awesome video ! You're teaching so much in such a short amount of time, while still going deep when needed.
@trashikan3 жыл бұрын
Man you deserve a lot of love! This video has been extremely helpful. Hope you'll keep making more tutorials and content like these. Awesome work!
@DawnosaurDev3 жыл бұрын
Thanks so much, yeah hoping to make a V2.0 at some point :D
@bapabs3 жыл бұрын
Very nice video, very educational and also nice, smooth video animation.
@jarrettonions3392 Жыл бұрын
thanks man. this is awesome. there are so many ways to do this but none of them feel as nice as i would like. I havent tried your way yet but it takes into account a lot of factors that i havent seen considered elsewhere. well done!
@avivyoukerharel21403 жыл бұрын
Amazing tutorial, You've got yourself a new subscriber! (Also, I just remembered I played you game in the brackeys Game jam, it was super cool)
@DawnosaurDev3 жыл бұрын
Thanks so much :D
@sasquatchbgames Жыл бұрын
this system is FANTASTIC!! 1 question though, wondering if anyone knows. Instead of flipping the Scale on the X (or changing the "FlipX" on the Sprite Renderer) to get the player to turn around, I generally like to use transform.Rotate(0,180f,0) to get the player to turn around. That way, the actual transform.right flips, and so any children of the player also turn around properly (and saves you from having to do multiple checks on both the left and right side) However...implementing this seems to result in a VERY slight (but noticeable) jitter for a frame when the player turns around (only when in the air interestingly) - happens with or without camera follow. I'm looking for the smoothness you get from flipping the Scale on the X, but the functionality of changing the transform.right. And I don't really want to interpolate the rotation as this produces a Paper-Mario-like effect. Any ideas anyone? EDIT: solved. This seemed to be a problem when my character was in the air only (gravity using RB, therefore physics simulation) - and since I was checking for this rotation change in update, the physics vs the transform change were fighting each other that frame, resulting in the jittery motion. So the fix, IF you are wanting to change the player's transform.right directly (instead of faking it by using -1 on the x scale) - is to call the CheckForTurn() function in FixedUpdate, not Update.
@DawnosaurDev Жыл бұрын
Awesome, happy to hear you got everything working. Thanks for writing an explainer and the kind words :D
@stevie.70373 жыл бұрын
thank you so much for creating this video it has influenced me to get into coding
@DawnosaurDev3 жыл бұрын
Hey! fancy seeing you here ;D
@Nicklefritz2 жыл бұрын
Please keep making great videos like this one! They are well-edited, concise, and pack a lot of useful information in a short amount of time! Also, you explain things incredibly well!
@DawnosaurDev2 жыл бұрын
Thanks so much!
@MegaWoohooyeah3 жыл бұрын
HIgh quality for such a small channel
@amogh21013 жыл бұрын
This is a very well done tutorial! It covers a lot of ground and gives plenty of code examples for me to replicate. Thank you and keep up the good work!
@TheNore55152 жыл бұрын
Great visualization on why the issue happens! Good video.
@geekjoystick3 жыл бұрын
Great tutorial! That's a really clean platformer controller you've made. Can't wait to see what you do next ;)
@DawnosaurDev3 жыл бұрын
Thanks so much! Hopefully i'll finishing up my next video soon :D
@lamngo9108 Жыл бұрын
thank you so much. That will help my game much less boring
@Lusiogenic2 жыл бұрын
Awesome analysis, thanks. 🙂
@linzenmeyer3 жыл бұрын
Wow bro, really well covered.
@TacticalProgrammer3 жыл бұрын
Very Awesome video Mate! Straight to the point with Amazing tips! KZbin needs more tutorials like this. Keep it up!
@DawnosaurDev3 жыл бұрын
Thanks that means a lot :D
@comeonthere39592 жыл бұрын
Best video I've seen on game development
@DawnosaurDev2 жыл бұрын
Thanks so much!
@georgemcgurkin78463 жыл бұрын
great video, really helped me out w/ my project for school!
@DawnosaurDev3 жыл бұрын
That's awesome! What's your school project on if you don't mind me asking?
@georgemcgurkin78463 жыл бұрын
@@DawnosaurDev We are making a 2d platformer in unity for our final project in my game design class, and my game really benefited from less floaty controls
@DawnosaurDev3 жыл бұрын
@@georgemcgurkin7846 Neat! Hope it goes great
@hyper1903 жыл бұрын
This is really good! keep going!!!
@DawnosaurDev3 жыл бұрын
Thanks a lot :D
@jamyanvance Жыл бұрын
>:D this was a really good base for 3d first person movement! thank you so much!
@TRMrStone2 жыл бұрын
Thank you so much, I'm currently learning unity and wanted to do a super smooth Gameplay, but I only got close, now I can finally implement this :D
@cookiecrayon3 жыл бұрын
This is so awesome! I've been looking for a way to create a 2D platform character controller that works with Physics for a long time but just couldn't seem to find any good tutorials or examples online. I downloaded your project and was so happy at how clean and tidy the code and the scene are! Thank you so much for the amount of work you put into this! Have you thought about creating a step-by-step tutorial on how you created the code for the playerMovementImproved script?
@DawnosaurDev3 жыл бұрын
Thanks so much! I probably won't make a step by step tutorial, but if you have any questions about the code, feel free to ask me anything here :D
@cookiecrayon3 жыл бұрын
@@DawnosaurDev Thank you!
@RGBA3 жыл бұрын
Thank you sooo soo much, i have been struggling with movement soo loong and this helped me so much
@DawnosaurDev3 жыл бұрын
happy it helped :D
@RGBA3 жыл бұрын
@@DawnosaurDev when new vid
@DawnosaurDev3 жыл бұрын
@@RGBA Ooo hopefully in maybe 1-2 weeks (devlog video this time)
@RGBA3 жыл бұрын
@@DawnosaurDev oo nicee
@anagami01392 жыл бұрын
This video is completely insane, just continue what u doing it's amazing :D Gj mate
@DawnosaurDev2 жыл бұрын
Thanks a lot :D
@luxtriumphans11223 жыл бұрын
The presentation was excellent and I learned a thing or two. Now do one for the oh so important Dashing!
@DawnosaurDev3 жыл бұрын
Thanks, definetly in the next one :D
@merttremable7 ай бұрын
bro has changed the industry without noticing
@scriptyshake2 жыл бұрын
This is exactly what I needed for the platformer game I'm making, inspired by Celeste and Ori. Earned yourself a sub :D
@orangelimesky2 жыл бұрын
I can't believe I missed this tutorial. I used to see this video pop up a lot but always assumed I'd seen it already. God damn it all. I've been squinting at my player's jump. I've gotten it down using velocity instead of add force, but there was always something off about it. Like it didn't feel natural. And the code to control things like gravity, deceleration and acceleration is really messy with velocity compared to that clean force code. Thank you.
@DawnosaurDev2 жыл бұрын
Happy it helped!
@fujoridev Жыл бұрын
Самый полезный канал по разработке, который я только находил, божественно! Хочу больше видеоуроков😍
@miaoumixed42683 жыл бұрын
Hi, thank you for this video. Great to find a different way to move than the usual rb.velocity = ... Also, good to see that you use the new input system. M. D.
@sh1k1kate2 жыл бұрын
thank you very much for such a masterpiece of a video!!!! only 7 mins, but much more informative and useful than longer ones. 🔥🔥🔥🔥
@DawnosaurDev2 жыл бұрын
Thanks so much! Happy it helped :D
@brendong86643 жыл бұрын
fantastic video man!
@DawnosaurDev3 жыл бұрын
Thanks so much :D
@minoupitou15032 жыл бұрын
i always thought i needed to use kinematic and build a whole physics system to be able to make this kind of controller. As i'm making a small project (which is basically a celeste rip-off let's be honest) this video is helping me, and will help me get a better understanding of unity physics system. you are too kind. Thanks man. i mean it.
@keinepanik_Bojack Жыл бұрын
Great video. It is easy to make a platformer. But a good player controller is so important for a really good game
@niIIer12 жыл бұрын
Thanks. The exact kinds of tips I was looking for!
@Гречкавкусная-ф8д2 жыл бұрын
Great video! Hope to see your future videos
@psychrockenjoyer2 жыл бұрын
Great tutorial format! Loved it! :)
@CalvinWoodruff Жыл бұрын
Amazing video! For these examples, what was the mass of the player's RigidBody?
@DawnosaurDev Жыл бұрын
Always 1
@Aquasponse5 ай бұрын
This is really helpfull! You explain this really well and its really easy to follow
@PearlyMishima2 жыл бұрын
Thank you so much for this video, man. It had so much info I've never considered, keep it up! :D
@lizardltd Жыл бұрын
Thanks! This helps a lot
@tzouandy2 жыл бұрын
Oh god, this video is really good and helpful. Hope you can keep doing this series.
@JujuProdGames3 жыл бұрын
Wow. This video is very well made and informative. Congrats dude! For some feedback, I would suggest adding some diagrams when explaining the coding parts to break up some of the visual monotony. The video flows super well, while keeping a steady pace. Subbed, fantastic job!
@DawnosaurDev3 жыл бұрын
Thanks so much! Yeah, diagrams are a great idea. I'll definitely be putting that on the to-do list for any sequels i make :D
@TriCombStudio2 жыл бұрын
Well done man, super informative
@DawnosaurDev2 жыл бұрын
Thanks! Happy it helped
@adalmara40003 жыл бұрын
Really well explained. Thanks, have subscribed and will definitely check out your future tutorials.
@DawnosaurDev3 жыл бұрын
Thanks, glad it was helpful : D
@bloom9452 жыл бұрын
2:53 I think you should multiply the force with Time.fixedDeltaTime, since it runs every physics update
@bloom9452 жыл бұрын
forgot to mention, great video btw!
@DawnosaurDev2 жыл бұрын
The run is called in FixedUpdate() so this kind of already happens. FixedUpdate will always be called 50 (for unity's default value) times a second, so there's luckily no need to worry about multiplying by a deltaTime. Great question, I'll add that in if I make a sequel :D
@Bl0oDStEEl2 жыл бұрын
The first time I click the 'jump' keybind it doesn't register at all; it only starts working after the second one
@DawnosaurDev2 жыл бұрын
Hmm I'm not sure. I've checked my current version of the platformer project and this doesn't seem to happen to me, but I have seen this issue before. My best guess would be a possible issue with the timers when you first jump or an issue with Unity's handling of input
@ubernaffa7 ай бұрын
God damn, what a video. Coding noobs are only able to experience the creative joy of game development because of amazing content like this - thank you!
@hubertb5834 Жыл бұрын
This was great, really helps me a lot this is exactly what i needed. Thank You and keep it up :)
@goatfishplays2 жыл бұрын
I finally caved and decided to just use your movement tutorial, I tried for at least 8 to get and use my own movement system through the power of knowing a highschool amount of math and physics, this one works so much better lmao, at least I tried, good work with yours and thanks