SLOPE MOVEMENT, SPRINTING & CROUCHING - Unity Tutorial

preview_player
Показать описание
SLOPE MOVEMENT, SPRINTING & CROUCHING - Unity Tutorial

In this video, I'm going to show you how to further improve my previous player movement controller by adding slope movement, sprinting and crouching. (You can also use your own player controller if you want to)

If this tutorial has helped you in any way, I would really appreciate it if you leave a like in return. And you can also subscribe to this channel if you want to see more tutorials like this one.

Links:

➡️ Get Access to my full MOVEMENT LAB! ➡️

🏹 Get Access to my RANGED COMBAT LAB! 🏹

Other interesting videos :D

Support me on Patreon:

#UnityMovement #FirstPersonMovement #UnityTutorial
Рекомендации по теме
Комментарии
Автор

If you need help with any of the code shown, just visit the "coding-help" channel on my discord server :D
Also you can find many more movement tutorials on my channel in the "Tutorials!" playlist - I really hope they help you on your further GameDev journey!

And in case you're interested in getting access to my full MOVEMENT LAB, where I combined all of the movement abilities shown in the tutorials and some more, check out the trailer:

Also, since I know lot's of you are interested in ranged combat as well - I can gladly announce that I'm about to release my RANGED COMBAT LAB as well:

Thanks so much for watching, hope this tutorial has helped you!

davegamedevelopment
Автор

You know, these are the types of tutorials you like to see, straight to the point, easy to follow, but now boringly slow, and explained perfectly. Keep up the good work 👏

JW.
Автор

For those struggling with very weird movement on slopes and not being able to jump on them, try changing the line "grounded = Physics.Raycast(transform.position, Vector3.down, playerHeight * 0.5f + 0.2f, whatIsGround);" to "grounded = Physics.Raycast(transform.position, Vector3.down, playerHeight * 0.5f + 0.3f, whatIsGround);" sp change 0.2f to 0.3f. Atleast thats what fixed it for me

AgentNano
Автор

0:28 sprinting
2:07 crouching
3:46 handling slopes

just_gaminlive
Автор

will get it. Just don't get burnt out. Whenever you need a break, take one.

jeanpiereramospatricio
Автор

Please pin this comment, for those having issues with going down slopes being bumpy please make sure that the series of if statements in the move player method are else if's and not multiple different if statements. Also in the state Handler method please make sure that they are all else if until the last one which is an else because otherwise your code won't work correctly. This is what caused issues in my code and it took me forever to figure it out. Please make sure that these are correct.

LM-ccqz
Автор

For people struggling with the slope with high character velocity, you can add more force to "80f" so you don't get launched in the air, but dont put too much or you'll be stuck on the slope which is worse

dalidasse
Автор

Two things:
1. THIS IS AMAZING. I'm going to get everyone I know to watch and subscribe.
2. Thank you comment section for being the answer to my problems!

sofiaonaga
Автор

alternatively, you could use animations for crouching.
you can simply create an animation within the Unity dope sheet animator, move the players collider and model down, resize things if needed to prevent clipping, or pose them as well if they are a rigged model.
this should resolve any temporary floating in mid air, though you could simple make an if-statement and alternative animation for when the player model is not grounded so that they don't suddenly drop downward.

there's always much more easier alternatives, provided you learn about their attributes

fuzziau
Автор

Ay nice I have actually added sprinting myself before you made this so I was proud of myself also, what an awesome tutorial man keep it up.

Hyphen
Автор

There will be no need to add downward force on crouch if your player's pivot is at his feet.
This also negates the need to know the player's height before raycasting to check for ground.
And additionally helps placing units/characters in the scene without needed to adjust their Y position so they don't clip through the ground.

MaxIzrin
Автор

your tutorials are superb! please do more of these, you dive deeper than many of the existing chanels and provide us with great learning opportunities

yairtayb
Автор

This has seriously been a god send, thank you for making these videos, I've learned so much in a such a short amount of time and it is very easy to adapt into my own project

Chaomaster
Автор

I liked and saved your every single video. It's so helpful for my summer vacation game projects

__Rizzler__
Автор

Thank you so much! Please keep making these tutorials, they are awesome!!

michaelechim
Автор

Damn bro top tier content, I'm sure you had to visit multiple countries to produce a masterpiece like this

johanjaviernavarroticce
Автор

These tutorials are great, did have an issue with my crouchSpeed not being used whenever i crouched, after i saw that, i noticed that my movement state wasn't being saved. Just had to set the next if statement to else if in the StateHandler!

mas-o
Автор

This tutorial has made me realize my typing skills are lacking lol.

timothybaldinger
Автор

it took me many hours to figure how to do slope movment but your method is easy , thanks a lot

AhmedMohamedHassan-tb
Автор

Hello, tank you very much. I started unity last week and you have helped me a lot.
I have did all of your movements lab tutorial

aymeric-devv