Тёмный

Character Controller With Animations - Walk, Run, Jump & Attack - Unity 2020 - Beginner Tutorial 

Single Sapling Games
Подписаться 19 тыс.
Просмотров 225 тыс.
50% 1

CHARACTER CONTROLLER WITH ANIMATIONS - WALK, RUN, JUMP & ATTACK - UNITY 2020 - BEGINNER TUTORIAL
Oy friends, in this video I show you how to make a character controller with animations. I will show you how to add movement like walking, running and jumping. I also included a simple attack system.
Before you ask I will not be sharing the scripts. I think that all of you can do it just make sure you exactly follow the video. If you have any issues comment below and I will try and help you.
Feel free to donate if you are rich :D
streamlabs.com/singlesaplingg...
--Toon RTS Units Demo(Model and animations)--
assetstore.unity.com/packages...
Thanks to: Robin Brown, Tom Taborovski and Samin Grahic for their support on Patreon.
Timestamps
0:00 Intro
0:36 What are we making?
0:57 Scene & Player Setup
3:16 Player Movement
17:18 Gravity
24:34 Jump
26:47 Camera Controller
32:13 Movement Direction Fix
33:50 Adding Movement Animations
40:43 Adding Attack Animation
48:17 Outro
Discord Server - / discord
Patreon - / singlesapling
Twitter - / singlesaplingg
Reddit - / singlesaplinggames
Instagram - singlesapli...
DeviantArt - singlesaplinggames.deviantart...
Facebook - / single-sapling-games-2...
Itch.IO - single-sapling-games.itch.io+
Tumblr - / singlesapling
RU-vid - / @singlesapling
--Programs--
Engine: Unity - unity3d.com/
Modeling: Blender - www.blender.org/
2D Editing: Krita - krita.org/en/
Programing: Visual Studio - visualstudio.microsoft.com/
Organization: Trello - trello.com/
--Outro Music--
Song: Horizon (feat. Tylah Rose) - Loreno Mayer & Haesën
Music provided by Ninety9Lives
Video: • Loreno Mayer & Haesën ...
Download: 99l.tv/88HorizonYU
--TAGS--
script make game for free 2020 development dev unity blender program tutorial guide new hd twitter youtube developer indie design art cool easy quick fast fps first person shooter game gaming how to intro introduction learn teach learning teaching livestream live stream indiegamedev indiegame indie unity2020 blender3d unity3d devlog script beginner animation animator mask scripting movement character controller walk run sprint jump gravity attack attacking

Игры

Опубликовано:

 

29 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 862   
@idkl
@idkl 3 года назад
the intro got me crying, ty
@ZackDaly
@ZackDaly 3 года назад
Best intro ever. A rare occasion where I jumped out of full screen specifically to like and subscribe, 10 seconds into a video of a content creator I’ve never heard of. Awesome. How did he know exactly how Christmas goes for me!? EVERY. SINGLE. YEAR.
@letmedoit.
@letmedoit. 3 года назад
One of the best ways to explain character controller and animator controller Watched so many RU-vidrs didn't get it But thanks to you for making this , keep going
@dkordy
@dkordy 3 года назад
oh my god, i learned more here with you than i watched 50 of some other tutorials. You are fantastic and fun and very concise. I like you a lot, I really learned more with your tutorial than I listened to fifty others (I repeat, but I have to repeat). Thank you very much! This is the first, your tutorial that I looked at(because I was searching for character control with animation), so after this I can only say that I hope you have more content like this. You really helped me! Thank you!
@dkordy
@dkordy 3 года назад
and when you say=God damn it....soo ..sweet..
@Fanoflix
@Fanoflix 2 года назад
Legendary video.I had 3-4 unique cases I was having problems with, and this one addressed them all. Thanks!
@devinjackson6437
@devinjackson6437 2 года назад
Bro this was literally by far the best video I've found so far. You use barebones objects and get right to the point when explaining concepts. I appreciate you so f***kin much my guy
@SingleSapling
@SingleSapling 2 года назад
:DD
@yanes623
@yanes623 2 года назад
One of the most complete and easy to follow, animations tutorials, great work!
@MrDonovanCerminara
@MrDonovanCerminara 2 года назад
Tremendous tutorial, sir. Unlike some C# wizards out there, you actually take the time to lay out the why behind your code in a way that teaches strongly. Thanks very much!
@SingleSapling
@SingleSapling 2 года назад
:)
@kidnimbus3562
@kidnimbus3562 2 года назад
Amazing Tutorial. After 2 days going through other tutorials I was about to explode, they were either not explaining enough or too complex. I was about to give up and try to find a easy download script but I felt lame because I wanted to actually learn how to code it. This tutorial explained so much where I almost feel confident that I can add a dodge animation myself and code it. Thank you so much Merry Christmas
@e.l5490
@e.l5490 2 года назад
Thank you so much. I could never find a tutorial like this to use animations, now I can finally use unity in peace.
@yab0411
@yab0411 3 года назад
Been watching lots of character controller tutorials, and this is definitely the best I found
@unitygamedev5951
@unitygamedev5951 3 года назад
for sure it is
@mikoseru5569
@mikoseru5569 2 года назад
I agree!
@SingleSapling
@SingleSapling 2 года назад
Ah shiiit thanks
@DiegoSynth
@DiegoSynth 11 месяцев назад
Each time my animations break, I need to find your video and you always fix them! You are the only one who shows how to properly do this. Thanks!
@youknowtherulesandsodoi1126
@youknowtherulesandsodoi1126 2 года назад
After some problems and issues I FINALLY finished and I am so happy XD
@activemotionpictures
@activemotionpictures 3 года назад
Perfect!! Thank you!! This is what I was looking for.
@snakeplisken4278
@snakeplisken4278 3 года назад
Love your style and sense of humor. Please make this into a full series with enemies' health, dialog, and more. god damit haha. Make a series that is a full game like Dark Souls maybe but keep up the excellent explanations, that is really helpful. The character can attack in the air at the moment, so maybe check isGrounded before allowing attacks? Like this maybe: private void Update() { Move(); if (Input.GetKeyDown(KeyCode.Mouse0)) { if (isGrounded) { StartCoroutine(Attack()); } } }
@keithfrechette8058
@keithfrechette8058 2 года назад
Why not attack in their air? How else could Gandalf have kept beating the crap out of the Balrog while they were falling? Surely you wouldn't say to Gandalf, "You cannot attack!" 🙂
@julesvilain4863
@julesvilain4863 2 года назад
make a special strike down attack when not grounded
@user-ji7rm4iz9s
@user-ji7rm4iz9s 3 года назад
thank you man . your transform.TransformDirection function helped me a lot . i waisted time on a lot of tutorials but your is the one which helped
@clintonhawkins8666
@clintonhawkins8666 2 года назад
I'll repeat what everybody else is saying, thank you so much. I have followed so many other tutorials and could not get the mask to work correctly without adding it to a separate layer. You saved me so much continued frustration.
@michaelwilson8461
@michaelwilson8461 3 года назад
Nice , simple and straight forward. Thanks man.
@willholt6389
@willholt6389 2 года назад
Great video. Right to the point AND actually uses a lot of the tools that Unity has to make things easier, unlike some. A+!
@SingleSapling
@SingleSapling 2 года назад
Thanks :*
@yakuplayk3532
@yakuplayk3532 3 года назад
Very good video and İntro is so good. :D
@MToryYT
@MToryYT 2 года назад
Thank you so much for the amazing video. There are plenty of great tutorials out there but this is so far the best. It was easy to apply the animation to my character controller script too.
@SingleSapling
@SingleSapling 2 года назад
:}
@mlgfrog2470
@mlgfrog2470 3 года назад
Oh shit didn't know you made an update! Thank you very much kind sir!
@touqan5091
@touqan5091 3 года назад
I figured it out btw amazing tutorial keep up the good work my dude.
@papadumas6689
@papadumas6689 Год назад
Very well done. This is what I have been looking for. Thanks!
@sagarsuman1299
@sagarsuman1299 Год назад
Just loved it really explained so well couldn't resist commenting
@ayushsidam289
@ayushsidam289 3 года назад
Thanks brother u r awesome. I didn't know anything about Unity and now I learn how to control a character. 😇🙏🏻
@xongram3139
@xongram3139 3 года назад
Helped me a lot with animation....Thank You so much
@knp3715
@knp3715 3 года назад
Thanks man this was what i been searching for, for months u did gud
@thuongtrinh9364
@thuongtrinh9364 2 года назад
Thank you so much man, this tutorial is amazing
@Etherealscorpions
@Etherealscorpions 3 года назад
For anyone that's struggling with the last part of the video - the "making the legs walk while we swing our sword part", what worked for me was going to the Avatar Mask, going back to that green human-shaped interface, and making the legs red. Because the model used in this video is, in fact, a humanoid, and not a generic as the video claims. Aside from this one thing, the video is great and answered a lot of questions I didn't even know how to ask. PS: adding (anim.GetLayerWeight(1) == 0) to your attack check in the update function will ensure you don't start another attack animation while one is already playing.
@sreelol7376
@sreelol7376 2 года назад
thanks dude
@Gijs9114
@Gijs9114 2 года назад
I tried this but once i add `` && (anim.GetLayerWeight(1) == 0) `` to the if statements condition check i can't attack
@Etherealscorpions
@Etherealscorpions 2 года назад
@@Gijs9114 to doublecheck, your update function looks like: private void Update() { Move(); if (Input.GetKeyDown(KeyCode.Mouse0) && (anim.GetLayerWeight(1) == 0)) { Attack(); } } and doesn't work?
@Gijs9114
@Gijs9114 2 года назад
@@Etherealscorpions almost exactly. i still have written StartCoroutine(Attack()); instead of just Attack();
@Etherealscorpions
@Etherealscorpions 2 года назад
@@Gijs9114 ah right, i forgot i changed it a bit. I modified the code a bit in order to test out a combo attack feature. here's the code for that, in case it helps: private void Attack() { Debug.Log("Attack!"); if (Attack1combo) { StartCoroutine(Attack1()); } else if (Attack2combo) { StartCoroutine(Attack2()); } } private IEnumerator Attack1() { anim.SetLayerWeight(anim.GetLayerIndex("AttackLayer"), 1); anim.SetTrigger("Attack1"); yield return new WaitForSeconds(0.7f); anim.SetLayerWeight(anim.GetLayerIndex("AttackLayer"), 0); Attack2combo = true; Attack1combo = false; yield return new WaitForSeconds(0.5f); Attack2combo = false; Attack1combo = true; } private IEnumerator Attack2() { anim.SetLayerWeight(anim.GetLayerIndex("AttackLayer"), 1); anim.SetTrigger("Attack2"); yield return new WaitForSeconds(0.5f); anim.SetLayerWeight(anim.GetLayerIndex("AttackLayer"), 0); }
@yeeyee_anime
@yeeyee_anime 3 года назад
the only thing i get excited for now is a good teacher on youtube and this tutorial is real great way better than ur other one.
@iggy666
@iggy666 2 года назад
Everything works well, thank you very much for the tutorial!
@michaelrosenfeld8055
@michaelrosenfeld8055 2 года назад
Thank you so much for this. I am one of those idiots who lacks patience to read through documentation until there is no other way. Awesome Job!
@SingleSapling
@SingleSapling 2 года назад
:D
@rs92_
@rs92_ 2 года назад
Thanks. You maded the most clear unity tutorial i ever seen
@SingleSapling
@SingleSapling 2 года назад
;)
@YA-vl8jh
@YA-vl8jh 2 года назад
Very well made and explained 👌
@madlad2470
@madlad2470 2 года назад
not gonna lie this is best video i ever seen its explain how to make nice movement for characters. ive seen many videos but this one is amazing one. KEEP IT UP
@SingleSapling
@SingleSapling 2 года назад
@ollocksbay
@ollocksbay 2 года назад
Brilliant, this was exactly what i needed to get started, thank you dude!
@stylie473joker5
@stylie473joker5 2 года назад
glad it worked for you, for me none of the animations worked so i changed to getcomponent instead and now only idle animation worked other didn't any idea why its happening ?
@ollocksbay
@ollocksbay 2 года назад
​@@stylie473joker5 did you change the threshold? so the idle,walk,run is set to 0,0.5,1? cause if you're only left with the idle its possible the threshold is left at 0 and idle is st first? i have little to no experience apart from this tutorial video and some of brackeys
@tigranziberov-mkrtchyan6375
@tigranziberov-mkrtchyan6375 2 месяца назад
One of the best character controller explanation ,thanks a lot
@TakeOneCandy
@TakeOneCandy 2 года назад
This is what I have been looking for a week. Thanks, u earned a Sub
@SingleSapling
@SingleSapling 2 года назад
thanks
@LORD---BrazilianSoldier
@LORD---BrazilianSoldier Год назад
Worked perfectly, youre amazing, thank you so much soldier
@mackmartin8561
@mackmartin8561 2 года назад
Fantastic video. I was able to translate what I learned directly into animating another model and getting strafing into the controller as well! I'm working on sorting out that attack delay you mentioned, but I'm having a hard time figuring out a smooth way to delay that input, so if you tackle that in another tutorial I'd love to know! Thanks again for a great learning experience!
@SingleSapling
@SingleSapling 2 года назад
Nice, glad I could help, maybe I should make a bit more of a advanced controller tutorial :]
@justscrolling97
@justscrolling97 2 года назад
could you please tell me about jump animation, i am doing it but on doing so character is moving out of the character controller cylinder which is obviously creating issues please help if you know
@SingleSapling
@SingleSapling 2 года назад
U need to attach colliders to the bones
@eddyperera6780
@eddyperera6780 2 года назад
I love the tutorial. Thanks a lot!
@victor1102
@victor1102 2 года назад
This is epic, thank you and keep up the goodies, cheers!
@victor1102
@victor1102 2 года назад
Btw, superb clear explanation, really a job well done, thank god I found your channel!
@masumhossain2836
@masumhossain2836 3 года назад
One of my best tutorial as a beginner
@jeanmaurice1549
@jeanmaurice1549 2 года назад
The only tutorial that worked nice job!
@MAx2L4eva
@MAx2L4eva 3 года назад
i love your tutorial and the way you do insults , 10/10
@SingleSapling
@SingleSapling 3 года назад
Hhahaha thanks
@SAROCKX_ART
@SAROCKX_ART 2 года назад
Thanks a bunch, dude! you are amazing and funny :) I look forward to more gifts!
@avanishpatitripathi1562
@avanishpatitripathi1562 2 года назад
I love this... I wish more tutorials were like this...
@SingleSapling
@SingleSapling 2 года назад
;)
@edanurkulac2660
@edanurkulac2660 3 года назад
Thank you so much man. Very great video.
@6fukraken
@6fukraken Год назад
The best tutorial i have seen. Thank you!
@GLORIA-iv4ij
@GLORIA-iv4ij 3 месяца назад
This is the best guide ever, thank you so much for this
@hazel_yd
@hazel_yd 3 года назад
Perfect explaining :)))))))) Thanks a lotssss
@Siddhantmane03
@Siddhantmane03 3 года назад
THANKS MAN ITS REALLY HELP!
@SingleSapling
@SingleSapling 3 года назад
:*
@thomasgrill8983
@thomasgrill8983 2 года назад
Best video I have ever seen about character controllers. Charm Top Explanation Top Subscribed immediately
@SingleSapling
@SingleSapling 2 года назад
@Nick-rq4gy
@Nick-rq4gy 3 года назад
I saw this and it was excellent thank you
@erngkmn
@erngkmn 3 года назад
Clear explanation I ever seen.
@berkerdemirer7982
@berkerdemirer7982 3 года назад
This is simply amazing.
@amanpreetchander7386
@amanpreetchander7386 2 года назад
One of the best tutorial indeed. Thank you so much !!! This really helped !!!!!!!
@SingleSapling
@SingleSapling 2 года назад
@MehmetSarkd
@MehmetSarkd 3 года назад
Thank you so much!
@mohammedabdo8147
@mohammedabdo8147 3 года назад
Bro your Explaining is very Good ❤
@ciphergrind4182
@ciphergrind4182 Год назад
Great tutorial! Thank you!
@Hiturion
@Hiturion Год назад
Cool tutorial man.
@Trocksimity
@Trocksimity 3 года назад
Great tutorial :D
@ahmetomercicek5848
@ahmetomercicek5848 2 года назад
Thank you for your educational content.
@stelcxantisto
@stelcxantisto 3 года назад
You save my day, I love you.
@tawfiqkhan-bf5lg
@tawfiqkhan-bf5lg 8 месяцев назад
Alhamdullah ,bro. i learn many thing from your video
@SABaruj
@SABaruj 3 года назад
Finally! after 3 days its finished, i learned something yes but i undo the last attack animation fix because to me, it looked better before that fix
@arbazjaved8664
@arbazjaved8664 Год назад
Bro that is very helpful thank you for this❤️
@KousseilaMd
@KousseilaMd 6 месяцев назад
ur the perfect guys at the perfect time, bro great video keep up
@Axeblade118
@Axeblade118 3 года назад
Thank You Sir Very Useful !
@muzlusut3831
@muzlusut3831 2 года назад
Nice one mate
@arooly
@arooly 2 года назад
Thank you, the tutorial is very good.
@SingleSapling
@SingleSapling 2 года назад
:*
@GuiJardim
@GuiJardim Год назад
Nice tutorial man!
@SingleSapling
@SingleSapling Год назад
thanks man
@cloudverbal6736
@cloudverbal6736 Год назад
Sir, excellent tutorial! Thank you very much
@SingleSapling
@SingleSapling Год назад
Thank you my dear sir
@trigmax
@trigmax 3 года назад
Oh thank you. this is best. tutorial
@pequeno3d
@pequeno3d 2 года назад
Clear and clean 🙏👍
@SingleSapling
@SingleSapling 2 года назад
Thanks
@Oh-ou4lp
@Oh-ou4lp 2 года назад
Best tut I came across ! I found it super f*king helpful when you explaned what the lines in c# were doing I like the fact heres what it is and this is why helps me understand better. THANK YOU! only problem so far is I cant get the chater to go in the direction its facing just along the one axis um this part moveDirection = new Vector3(0, 0, moveZ); moveDirection = transform.TransformDirection(moveDirection);
@gamegun7693
@gamegun7693 2 года назад
Yoo thanks because of you i can now make a animated 3rd person Character
@SingleSapling
@SingleSapling 2 года назад
Good :*
@henrypowell3496
@henrypowell3496 2 года назад
best video on character movement with animation
@kidnimbus3562
@kidnimbus3562 2 года назад
Here is the code if you want to move horizontal and vertical: float moveZ = Input.GetAxis("Vertical"); float moveX = Input.GetAxis("Horizontal"); moveDirection = new Vector3(moveX * moveSpeed, moveDirection.y, moveZ * moveSpeed); moveDirection = transform.TransformDirection(moveDirection); **Also I had to set the "move speed" to 1 in unity for this to work for some reason. Im a beginner so spent all day figuring this out, hope it helps someone out
@krishivs8400
@krishivs8400 Год назад
This doesn't work for me plz help me with possible fixes
@SingleSapling
@SingleSapling Год назад
What doesnt work
@krishivs8400
@krishivs8400 Год назад
@@SingleSapling only the w,s works and even if i stop pressing the w key my charecter continues to move
@krishivs8400
@krishivs8400 Год назад
but with a lesser speed probably 2
@SingleSapling
@SingleSapling Год назад
Let me see your code
@jenrin853
@jenrin853 3 года назад
Thanks for this tutorial, you are so amazing, thats what ı've looking for three days.
@SingleSapling
@SingleSapling 3 года назад
Thanks my dude. Hmmm, is it a warning or a error(red or yellow)?
@jenrin853
@jenrin853 3 года назад
@@SingleSapling fixed it already but ı just want to simply ask , ı am using that code (Vector3 moveDirection = transform.forward * moveZ;) instead (moveDirection = new Vector3 (0 ,0, moveZ)), because when ı use your code my character is going only one direction , not following the looking way ( ı mean face way) but if ı use my code instead it, its going anyway what ı want ( when rotate it with the mouse ofc), is that would be a problem with animations?
@jenrin853
@jenrin853 3 года назад
because my animations dont work.
@SingleSapling
@SingleSapling 3 года назад
That shouldnt be a problem for the animations, how exactly do they not work( do they not show up or?....)
@jenrin853
@jenrin853 3 года назад
@@SingleSapling Idle is working but the rest are not working, when ı press w its moving but not animating, ı did everything right,ı believe same as your video.
@rajshrihirgude8023
@rajshrihirgude8023 2 года назад
nice i would really try it
@safdardeveloper3804
@safdardeveloper3804 Год назад
You deserve the like only because of your humour! very funny while learning.
@SingleSapling
@SingleSapling Год назад
:*
@uroojakram8988
@uroojakram8988 3 года назад
youre a Life Saver
@mehrankhan7871
@mehrankhan7871 2 года назад
As a non coder this tutorial is really helpful
@wlidani711
@wlidani711 3 года назад
10/10 ty dude, u save my life
@nasossg
@nasossg 3 года назад
You deserve all the likes in the world
@mistakoruto
@mistakoruto 3 года назад
Adding Attack Animation - Save my life.
@PianeurYT
@PianeurYT Год назад
Thank you! :)
@iOriyrdi
@iOriyrdi Год назад
Finaly,i didnt know how to move and attack without that Goofy slide,thank you
@CollapseDev
@CollapseDev 3 года назад
For anyome wondewring the part at the end to control and let an animation finish can be better done as an "animation behaviour" in mecanim. There you create a new script to access the on state exit and in that state you turn off your bool which would cause it to play that animation or change the state at animation end-these will allow you to play with time and allow animations to start and end properly so from there you just tweak usual transition settings to get it just perfect.
@kosmachor
@kosmachor 2 года назад
Thank you!
@mr.dingleberry4882
@mr.dingleberry4882 3 года назад
Lepo je videti da se ljudi sa nasih prostora bave game devom :D Samo napred, pozdrav iz Srbije
@SingleSapling
@SingleSapling 3 года назад
Bas lepo, fala lipo :D
@nileshkumawat2997
@nileshkumawat2997 Год назад
Thank you 😊
@melihcanozdemir7309
@melihcanozdemir7309 3 года назад
42:33 That's what i am searching about. Thank you bro
@manucheremeh5303
@manucheremeh5303 2 года назад
thank you so much, this is the best video about character controller I have watched so far Can I use the isgrounded property within the character controller instead of creating one?
@erisonveshi8406
@erisonveshi8406 Год назад
At the point whe he says: "Lets start with as simple private void start.... Heheeeeeeee good job right !?" Liked and Subed imediately lol
@dmars444
@dmars444 2 года назад
Also Sapling, when i watch these types of videos i manually write out the code step by step to get a firm understanding, if you were to supply your code it would make error checking 1000x easier because I could paste your code in and see if my jumps were performing the same as yours. This would mean that I have the code correct and that something else was causing me problems. Just a useful tool for fault finding, I ended up visiting Brackeys and the unity help documents and testing their code aswell and got the same weird mini pause at the top of my jump so either its meant to be like that or something wrong with a setting somewhere. kinda like velocity keeps trying to push my character upwards but he has hit his head on a roof, then once gravity takes over he starts falling. Couldnt really see if your character was doing it, any input/thought would be great.
@pwsherif4545
@pwsherif4545 2 года назад
Thank you!!
@capel7662
@capel7662 3 года назад
OH MY GOD! SO USING PLAYER MASK SAVES TIME IF YOU WANT TO EX: CROUCH ATTACK, PRONE ATTACK ETC. THATS HOW GAME DEVS SAVE TIME ON ANIMATING EVERY LITTLE DETAIL! Ahem... Sorry. You just blew my mind! You got my sub!
Далее
3rd Person Controller - Unity's New Input System
40:30
How to work with humanoid animations in Unity
12:50
Просмотров 18 тыс.
Optimizing my Game so it Runs on a Potato
19:02
Просмотров 443 тыс.
Create a Third Person Controller in Unity from scratch
1:51:35
Escaping Unity Animator HELL
18:18
Просмотров 496 тыс.
How to Become a Game Designer
15:08
Просмотров 1 млн
ПАРИРУЙ - Nine Sols
43:31
Просмотров 195 тыс.
Про обнову в GTA Online
14:46
Просмотров 91 тыс.