How to make Super Mario Bros in Unity (Part 2) - Movement/Physics

preview_player
Показать описание
Learn to make the classic 2D arcade game Super Mario Bros in Unity. Super Mario Bros is a platformer game developed and published by Nintendo for the NES game console. Players control Mario as they traverse the Mushroom Kingdom to rescue Princess Peach from Bowser. They traverse side-scrolling stages while avoiding hazards such as enemies and pits with the aid of power-ups such as the Super Mushroom, Fire Flower, and Starman.

0:00 - Intro
0:50 - Mario Prefab
6:15 - Horizontal Movement
18:35 - Side Scrolling
27:30 - Jumping
44:48 - Gravity
52:48 - Head Collision
1:04:40 - Wall Collision
1:09:17 - Physics Material
1:14:15 - Direction Rotation
1:17:38 - Mario Sprites
1:28:31 - Run Animation
1:39:39 - Outro

········································­­·······································­·­····

#unity #unitytutorial #gamedev #unity3d #unity2d #gamedevelopment #indiegame #indiedev #madewithunity
Рекомендации по теме
Комментарии
Автор

@Zigurous,

This series of videos is amazing. There is nothing better than re-creating classic games in Unity. I have learned so much already. It's straight to the point and explained very well. Thank you for putting in the time and effort to create such exceptional content. You sir, are a gentlemen and a scholar! 👍

humongouserectus
Автор

Fantastic tutorials, for me learning practical stuff is much more useful than dry theory with documentation, and the way you break the whole game into small digestible pieces, and how eloquently you explain each part and connect it all together is just fascinating. Huge props for your organization and explanation skills, they're exceptional

kripak
Автор

Hi Zigorous and thanks for those videos. I honestly think they are the best Unity resource on YouTube right now. If I may make a suggestion: write much less code before showing the result. Eg: you wrote the jump functionality all at once. Since it’s a complicated peace, it would work better if you showed when it DIDNT work ok. “Ok, see, Mario jumps, but you can keep jumping in middle air. Add a check to see if it’s grounded” ”Now he jumps, but it doesn’t fall down, see? Let’s code that.” “Now, as you can see, it falls down, but the physics are a bit off. Let’s add a multiplier”. And so on.

This would greatly help to understand WHY the things are done the way they are done!

Thank you for your time :)

pistacchioso
Автор

This is way better than UNITYs own teaching/training videos. I understand how you explain things way better.

cyberblitz
Автор

Whoa, amazing! This teaches so much about programming, C# and Unity. The explanations are clear, voice is good and calm. Pacing is excellent. Top quality video!

mielivalta
Автор

Great video, learned a lot. Just finished the video, no bugs, no problems, worked perfectly

keithfay
Автор

How would we prevent the wall velocity glitch for the camera barrier? Since we are doing this in the movement without a collider we can not use the raycast extension for the rigidbody.

Edit: I found a solution! Replace the clamping code with these lines:

Vector2 tempPos = position;
position.x = Mathf.Clamp(position.x, leftEdge.x + 0.5f, rightEdge.x - 0.5f);
if (position != tempPos) { velocity.x = 0f; }

ploopy-moddedminecrafttuto
Автор

Zigorous, your content is high quality teaching and all, but I wish I could show you how my smile faded when I realised the next tutorial was 2 HOURS💀💀

sazerae
Автор

Please someone help me! After coding jumping and gravity my Mario just starts to fall way down for infinity like there’s no collide between ground and Mario what’s I did wrong and what can I do to fix it!

toliiedits
Автор

EDIT: WATCHING MY CHARACTER MOVE FOR THE FIRST TIME WAS INCREDIBLE!!! THANK YOU!!!


Watching Mario move left to right at18:30 for the first time was extremely exciting! You should have added some game noises to video here and there! This is wonderful! Thank you so much for doing these tutorials!

TrickyMickTrucking
Автор

this is a great tutorial i think u need to check the mario slide when he slide he turn his face to where he is going not forward

yazanjordan
Автор

You set the x velocity to 0 when you are running but hit an obstacle such as a wall/pipe. However if you go back to the left and hit the edge of the screen but not an obstacle, the velocity doesn't get reset back to 0.

Also, what about fast running like you are holding down the b button?

celinedrules
Автор

In general you are good bro, in fact, I have learn many things with your tutorials and tips, really cool. The problem is not what you show, is that some things doesn't work in my side xD but I'm already fixing it. Hope to see more videos of yours after finishing the series.

Vanilthas
Автор

58:48 I would love to correct a small mistake here, which is that the dot product itself doesn't give those values (-1, 0, 1) but instead its the cosine in the dot product formula, let me explain further

so we have two vector belonging to R^n ( to any dimension, in this case 2d (R^2) or 3d (R^3) ) called U and V
U . V (U dot V)= ||U|| .||V|| .cos (U, V)
||U|| length of vector U
||V|| length of vector V
(U, V) the angle between the vectors U and V

so the operation U.V is going to give a scalar (normal number not a vector) that belongs to R

But cos (U, V) would give a number between -1 and 1, which is used to tell the directions of the 2 vectors compared to each other the way u explained it

1:00:18 I did a little search about unity's dot operator, and it does give off a result of a normal algebra dot operation, unless the vectors are normalized, in that case, it would return the results u have mentioned

nadadishouAr
Автор

This isn't really a problem, but my VS code doesn't display colors like yours for stuff like Mathf or whatever when the code is definitely correct, how do i change the settings inside VS code to match yours?

whitedeath
Автор

thanks for the nice video.
I think you should use the new input system in your projects,

alienouz
Автор

Hey, i'm new to all this and learning c# coding and using unity as i go. I have a problem though.
The menu that is under scene with the 2d and light bulb is not there on mine. Is it an error, do i need to download something else?

GhostXIII
Автор

Help me please. I did everything as in the video, but when the project starts, the camera does not see the character, the level itself is simply displayed, without the character.

Sergey
Автор

My Mario won't walk. All he does is stare at my soul.

cammyposey
Автор

Next tutorial make on UI menu and how to do transition between those levels scene . And make level selection menus..

Some animations using DoTweeen package to animate the UI button..?

abg