2D Top Down Pixel Art RPG Game Dev in Unity 2022 ~ Crash Course Tutorial for Beginners

  Рет қаралды 592,553

Chris' Tutorials

Chris' Tutorials

Күн бұрын

Пікірлер: 873
@Youtuber-ly6tx
@Youtuber-ly6tx 2 жыл бұрын
Followed the whole video, expecting it to take me 2 hours. It took me all day! Well worth it though. I have an actual player running around on screen killing enemies!
@michaeljoel8848
@michaeljoel8848 2 жыл бұрын
this comment makes me want to give it a shot. thanks!
@boerbol9422
@boerbol9422 2 жыл бұрын
Thanks for sharing!
@KUROI6969
@KUROI6969 2 жыл бұрын
did you just copy the code or improve it too? I'm hesitating to watch this because what if i just copied it and not learn anything
@AltDotAlex
@AltDotAlex 2 жыл бұрын
@@KUROI6969 copy code, then pause vid and think hard about next steps, write your guess down in comments in the code, then see how close you were. near the end of the video you'll likely be guessing the correct next step, even if you're not 100% on how to implement.
@okachobe1
@okachobe1 2 жыл бұрын
@@KUROI6969 another way to use these types of videos to learn is by adding on your own ideas after you have finished the tutorial. Then you have other code that's already working to use as reference for the new stuff you add
@Teelur
@Teelur 2 жыл бұрын
At 47:45 , if you don't have the sample rate (like I didn't), go to the far right of your screen and click the 3 vertical dots (under the lock) and select "Show Sample Rate" :) Edit: wow i didn't expect this to become the top comment 😅 Glad i could help you all
@MrArasbatu
@MrArasbatu 2 жыл бұрын
thank you
@smallfryskilledge1550
@smallfryskilledge1550 Жыл бұрын
Thanks
@ameytipre9699
@ameytipre9699 Жыл бұрын
I love the comments section for.this exact reason❤
@NickTerry1
@NickTerry1 Жыл бұрын
I know it's 6 months later, but you're an absolute godsend
@Teelur
@Teelur Жыл бұрын
@@NickTerry1 🫡
@nicka.7682
@nicka.7682 2 жыл бұрын
At 58:28, if you are experiencing jittering after adding the Cinemachine Pixel Perfect extension, make sure to DISABLE the default Pixel Perfect Camera component on your Main Camera game object. The two pixel perfect cameras can fight each other for control and add jitter.
@alcazarbrandon
@alcazarbrandon 2 жыл бұрын
thanks for this comment, was trying to figure out what has happening there. This immediately fixed!
@nickrossis5935
@nickrossis5935 2 жыл бұрын
I still experience jittering even though I disabled the pixel perfect camera on the main camera. And I dont see any difference when I turn the script on, it seems to have the same amount of jittering. Any idea of what the problem might be?
@iz2362
@iz2362 2 жыл бұрын
@@nickrossis5935 I'm not sure if you fixed this issue but I also had this issue (Seems common in URP). You can fix it by changing the Interpolate value in your players RigidBody2D component from None to Interpolate
@LinxDesigns
@LinxDesigns 2 жыл бұрын
thanks man, i was searching on the internet so long for this solution!
@JG-kb5nv
@JG-kb5nv 2 жыл бұрын
@@nickrossis5935 did u find a fix?
@lppassarelli1779
@lppassarelli1779 2 жыл бұрын
This is so great! I've been following along. I'm an hour in, with everything working smoothly! It's my first time working in Unity or in C (though I've used Python before.) I love how you model debugging and explain why you do each thing you do. I learned a lot of coding just from following along! Keep up the great work!
@Sultaneq
@Sultaneq 2 жыл бұрын
@Concrete Hi if u still need s answer i could give u one i Personly continued on it to improve diffrent kinds of Features and after i was more known to developing top down games i worked on own Projects.
@kathleenmacainsh1866
@kathleenmacainsh1866 2 жыл бұрын
This was such a great tutorial - thank you so much for putting it together. It was especially helpful that you showed how to use Unity's newer input system - as many tutorials are still using the older one. I like how you kept in your decision making when it came to writing the code as it put into context what it's actually like developing - that the way you decide to implement something could change. The one thing I'd note to anyone else following along is that there is a bug with the hit box collider - but it gets resolved later on in the tutorial. If the bug causes you issues before you get to the part where it's solved - just make sure you're using local position.
@Devcutter
@Devcutter Жыл бұрын
i do use localPosition but still my box collider get moved way down and opposite to where i am attacking ive read that it might be related to pivot point any idea ?
@mrt8bit692
@mrt8bit692 2 жыл бұрын
already 5 minutes in and know that this tutorial is going to be such a banger, thank you so much for putting this together!
@Qegixar
@Qegixar Жыл бұрын
Fantastic tutorial! Starting Unity projects can be really daunting with all of the gizmos that you need to configure, and I'd never done a 2d project before so I had no idea how to manage sprites or collision. This made setting everything up super easy to follow!
@christianstachl
@christianstachl Жыл бұрын
Thanks for this great tutorial! The tileset got updated and there are a lot more character sprites now. I was confused at first but figured it out and want to list them here for others: First 6 are idling looking down Next 6 are idling looking right (or left with flip) Next 6 are idling looking up Next 6 are walking down Next 6 are walking right (or left with flip) Next 6 are walking up Next 4 are attacking down Next 4 are attacking right (or left with flip) Next 4 are attacking up Last 3 are the death animation This makes it also "a bit" more complex if you want to incorporate every movement correctly, but i guess it's also a nice challenge to prove what you've learned here 😊 Have fun!
@65rega436
@65rega436 Жыл бұрын
my character wont move for some reason i need help
@talonman1825
@talonman1825 Жыл бұрын
would be nice if you shared how you figured it out, instead of just saying you figured it out.
@christianstachl
@christianstachl Жыл бұрын
@@talonman1825 Trial and error. I took the first batch, put them into animation and looked which one it was. Rinse and repeat with the others. Sorry, i thought it was obvious.
@djordjegrozdanovic3029
@djordjegrozdanovic3029 2 жыл бұрын
I just downloaded unity and your tutorial is the only one that doesnt take shortcuts. Finally i can code in unity
@FTZPLTC
@FTZPLTC 5 ай бұрын
Something BIG that I think got kinda glossed over a bit around 22:50 - once you install the Input System, you need to click "Play" before Player Input will show in Add Component. Putting this here in case anyone else goes looking for it =)
@sebastiansanhueza9601
@sebastiansanhueza9601 2 жыл бұрын
Just finished the whole tutorial, Chris! Took me at least two or three months, as I tried to commit to memory most of the code you wrote. I wrote a whole chunk day after day until I could write it by memory. I know the point is not to memorize everything, but the repetitive procedure really helped me to think about the logic of each line of code - thinking why a given object or function had to be private or public, why certain if-statements had to use an else-if or not, etc. You really packed a good chunk of must-know material in such a short video and I'll always be grateful for your time and effort setting these resources up!! Thanks!
@PedrovoriskAB
@PedrovoriskAB Жыл бұрын
I can't say dif, nicely said.
@turtlegod1013
@turtlegod1013 Жыл бұрын
Yeah I find with coding, because of the logical nature of the work, logical forms of studying such as memorization and application are more useful to learn it.
@MikeToth1
@MikeToth1 2 жыл бұрын
Thank you very much for this awesome tutorial :) For people who had problems with the jittering of the cinemachine. The solution I found was setting the damping of the vcam to 0 (Its hidden under the "body" tab). That way not only the jittering was gone, also the follow up from the camera was better for my taste. The character is always in the middle of the screen. Thank you very much again.
@carrotcarrot6961
@carrotcarrot6961 2 жыл бұрын
Thankyou so much I’ve been trying to fix this for over an hour and a half
@enlight_8360
@enlight_8360 2 жыл бұрын
Holy yes. This needs to be a pinned comment lol Thank you.
@MikeToth1
@MikeToth1 2 жыл бұрын
@@enlight_8360 You are very welcome. It made me crazy so I tried to help others with this solution :)
@sophiecharlotte3043
@sophiecharlotte3043 Жыл бұрын
This is my first time using unity. Already had troubles with the movement script. Decided that even though the editor said my code was fine, the issue had to be somewhere in there. Went on a tour through the internet, discovered the manual for the input system, read through several pages, copied and pasted code that was literally the exact same. I was going insane, ready to give of when I finally discovered my problem. The issue was… I wasn‘t actually running the game. I feel very stupid but I did solve my (non-existent) problem and I learned new things. 😂
@GreybeardVoiceover
@GreybeardVoiceover Жыл бұрын
Great tutorial! I love that you can get through this one in just over an hour (or two hours or so with pausing like me) and get quite a lot out of this. Other tutorials I have been doing are upwards to 10 hours long which can be really daunting. I ran into little hiccups and weirdness of course but was able to stay with you for most of it. I like that you left some little mistakes in as I was often able to catch them and fix them before unpausing the video as if it were a little quiz. Thanks!! Cheers
@slowfuse
@slowfuse Жыл бұрын
I got quite frustrated by how fast it moves, but tbh I can just replay and pause if I get stuck on something. Maybe faster is better
@tonioswald
@tonioswald 10 ай бұрын
​@@slowfuse yes the speed is kind of annoying and would prefer if the author would go more in depth but nontheless its still something to learn from
@rfygband
@rfygband 2 жыл бұрын
Really good tutorial. Having a lot of fun learning how to apply some previous coding I've done to making games. The only suggestion I'd make is to slow down the speed a bit. I put the playback speed on .75 and at my complete beginner level to Unity and this type of coding, it still seems like you're zipping around the menus really fast. I've had to rewind several times even on parts where you're going back into a menu we've been in previously because I couldn't remember exactly where it was located. Other than that, this tutorial is great and really looking forward to learning more from other videos so I can make some games!
@gamingprochampion5822
@gamingprochampion5822 Жыл бұрын
1:04:08 For those of you who have a frozen character after attacking, simply put ‘canMove = false’ into the ‘Onfire void’ and in the ‘OnMove void’ put in ‘canMove = true’ so you can have Unlock Movement and CanMove in walk, while only having CanMove = false in Onfire. Next, add UnlockMovement to idle animation, and you are now done. Character should be fixed. Hope this helps. Also, make sure to comment if it doesn’t work and i will try to help fix it
@helicopterkat1697
@helicopterkat1697 Жыл бұрын
I Cant get my character to even attack i have everything set but my debug says I'm calling Onfire' but it's never declared
@lietreumchanomai
@lietreumchanomai Жыл бұрын
Great man, Thank you! save my times :D
@lietreumchanomai
@lietreumchanomai Жыл бұрын
Maybe typo dude, cuz it should be onFire?@@helicopterkat1697
@shimii44
@shimii44 8 ай бұрын
BROOO EVEN ITS ALREADY 8 MONTHS AGO, BUT U HELPED ME A LOTTTT TYSMM
@FTZPLTC
@FTZPLTC 5 ай бұрын
Thanks, this seems to have worked - looks like it's a good idea to put "UnlockMovement" on the Walk animation too. You absolute gem! =D
@andrewmundy
@andrewmundy 2 жыл бұрын
For those who were got up to the movement script and werent able to move their character in game mode, make sure to assign the "Actions" in "Player Input" to the script you just wrote "PlayerInputActions (Input Action Asset)"
@shaunfuqua
@shaunfuqua 2 жыл бұрын
put it where?
@mayankbhaisora2699
@mayankbhaisora2699 2 жыл бұрын
@@shaunfuqua You need to create object of PlayerInputActions and then assign your methods to the Actions/Events.... playerInputActions = new PlayerInputActions(); // Enable action maps from the PlayerInputAction // eg. Player, UI etc.. Depends on your PlayerInputAsset playerInputActions.Player.Enable(); playerInputActions.Player.Move.performed += MoveMethod;
@Kingluxon
@Kingluxon 2 жыл бұрын
I already Assigned the Actions and its still not working
@evylrune
@evylrune 2 жыл бұрын
@@mayankbhaisora2699 No idea what that means and how to do it.
@evylrune
@evylrune 2 жыл бұрын
nvm chatGPT helped me lmao.
@shadowboi1812
@shadowboi1812 Жыл бұрын
cool tutorial video, in most unity tutorials, I never feel like I'm learning anything, except for this one, I was able to add basic modifications to your scripts. Nice Video
@ECAKJ
@ECAKJ 7 ай бұрын
if anyone gets STUCK when colliding, set offset to 1
@ayowtf813
@ayowtf813 Жыл бұрын
BEST tutorial video ever man, you've crushed it and explained everything so well
@macgeifer8850
@macgeifer8850 2 жыл бұрын
there is probably an error in 55:41. I replaced " > 0 " by " != 0 " because movement input can be negative. with " > 0 " you are not able to slide anymore at collision obstacles in negative directions of the coordinate system. if(!success && movementInput.x != 0) if (!success && movementInput.y != 0)
@xxMpEGxx
@xxMpEGxx 2 жыл бұрын
thanks that worked!
@terrorpotato
@terrorpotato Жыл бұрын
yea this is correct
@olegsemen3
@olegsemen3 Жыл бұрын
If you have jitter effect you need to change in the Main Camera object -> the CinematicBrain updateMethod to FixedUpdate and disable Upscale Render Texture in the Pixel Perfect Camera. If you disable the Pixel Perfect Camera on the Main camera - it will has another jitter vhs (i guess it's good description) effect.
@turtlegod1013
@turtlegod1013 Жыл бұрын
oh wow that worked perfectly! Thanks 👍
@slugg3r931
@slugg3r931 Жыл бұрын
This tutorial was great. One change I would recommend is to use the collider2D on the player for the Raycast check prior to movement instead of the rigidbody2D he uses. Using the rigidbody will make the raycast return any collision results for all colliders on the game object, including child objects. So it will keep you from moving if you have a separate weapon collider for example instead of just wanting to make sure you can't move when your feet collide with the terrain.
@turtlegod1013
@turtlegod1013 Жыл бұрын
i'll try that
@mustafaonly1127
@mustafaonly1127 2 жыл бұрын
Most underrated channel. Very detailed and informative explanation. 👌🏻
@lide8867
@lide8867 2 жыл бұрын
This is a great tutorial, I think it covers almost everything beginners need to learn to create a game with Unity - but sometimes it's hard to learn everything at once (at least for me). I was able to complete all the steps, but when I decided to start again with a blank project I was at loss. Your video is still great though, it has everything I'll need to learn in one place. I'll definitely be revisiting this in the future, thank you for sharing your knowledge!
@andogrando487
@andogrando487 2 жыл бұрын
If anyone is not seeing the place to enter the # of Samples you can enable it by clicking the three dots in the Animation pane an selecting "Show Sample Rate"
@dn2849
@dn2849 2 жыл бұрын
THANK YOU!
@enbermudas4269
@enbermudas4269 2 жыл бұрын
Thanks a lot!
@thatonefriend16
@thatonefriend16 2 жыл бұрын
thanksssss
@TRGantz
@TRGantz Жыл бұрын
Thanks!
@isagive
@isagive 2 жыл бұрын
The best new steps tutorial i have seen, thank you very very much ❤️❤️
@suzsg6169
@suzsg6169 2 жыл бұрын
I've just checked with the developer: every vertical layer in the original character/player sprite represents animation starting and ending sprites. So sprites 0-5 is idle, 6-11 is walking, 12-14 is an attack, and 15-17 is death.
@AllBecomesGood
@AllBecomesGood 2 жыл бұрын
Doesn't quite make sense to me. For me the vertical layer are clearly different animations, especially the last as he has the black dead eyes part of the death animation. So maybe you meant horizontal? Then the numbers are off. It'd be 0-3 (idle), 4-9 (walk), 10-16 (attack), 17-19 (damage taken) and 20-24 (death). And that then seems about right to me.
@juliencarvalho4881
@juliencarvalho4881 2 жыл бұрын
Dear Michael, it's you that make register for youtube, I follow your tutorial from bilibili to your channel here and I'll continue to support
@richardikin
@richardikin Жыл бұрын
By far the best Unity tutorial I've ever come across! I'm not a young man and I've struggled with Unity for some time, but not now. Coding isn't a problem but this type of engine is for some daft reason. Thankyou for finally clearing this barrier for me.
@blossomrose5134
@blossomrose5134 2 жыл бұрын
this is such a banger tutorial. very clear and have almost everything that i want
@clouds42069
@clouds42069 8 ай бұрын
Great tutorial, just a note for those with debugging errors with Visual Studio, you first need to update Visual Studio Code in Unity Extensions (Unity -> Window -> Package Manager -> make sure you have Visual Studio Editor and Visual Studio Code Editor), and then In Unity -> edit -> preferences -> external tools, set External Script Editor to Visual Studio Code. Then hit the Regenerate Project Files button, now open a script file from inside Unity and see if it's debugging properly!
@krzysztofpiatkowski1736
@krzysztofpiatkowski1736 Жыл бұрын
Thanks Chris. Good stuff. Explications was clear, I like the Your narration style, even with errors and alternative ideas. With video like this one a huge progress in learning process can be made!
@liammc433
@liammc433 2 жыл бұрын
Giving this a follow, just got up to the movement part about half an hour in and so far it's very easy to follow for a complete beginner like myself.
@AzziSenpai
@AzziSenpai Жыл бұрын
I had to really try hard to figure this one out. Don't know if I just missed it in the video or if it was the setting we set to default earlier in the video buuuut. Player input (the lightning bolt above our C# player controller script) > Default Scheme > Keyboard & Mouse. If you are using a keyboard and mouse and you just finished writing the C# player controller script only to freak out because your shits not moving. If you're like me its because you wrote FixedUpate in your code and didn't have this setting set up. Glad I got it fixed, my basic understanding of unity over these past few days has given me the confidence to look and guesstimate and it feels so good to run around in my own little world
@mushmello526
@mushmello526 2 жыл бұрын
14:01 Not much of a problem, but it's Control, not Shift. With shift you can select 2 elements and all in between get selected too, so in your example you can select grass, press shift and also select decor 16x16, that includes fences too
@jamesgill6028
@jamesgill6028 Жыл бұрын
Excellent tutorial! Ive been a c# developer for years and always wanted to dip my toe into games development. Thanks for the tutorial!!!
@Paul_LaSalle
@Paul_LaSalle Жыл бұрын
very cool Chris, I was just working on a top down retro demo and ran across this vid. Extremely helpful!
@MiishaMii
@MiishaMii Ай бұрын
Amazing Video, thank you! Only note I would have: You switch really fast sometimes when coding or chancing things, it would be great to get a few seconds to pause, especially in a long video like this where going back is a nightmare.
@1youyami
@1youyami Жыл бұрын
The best tutorial I've ever seen, thank you very much!
@mysterious_monolith_
@mysterious_monolith_ Жыл бұрын
You are such a good teacher!
@TheSoctorDuessExperience
@TheSoctorDuessExperience Жыл бұрын
Am I upset we didn't do the enemy movement together? Of course, I am. I didn't want this tutorial to end!! But the main reason I was able to complete is because it was only 90 minutes, and it was straight to the point while also being very informative. I could not have asked for more from the instructor. 10/10
@izaya_00
@izaya_00 Жыл бұрын
Such a wonderful tutorial, but if you want a challenge while going through it, the free asset mystic woods actually has sprites for all x and y directions. This includes their idles and moving sprites. So when he goes over movement and attacks this was an awesome way for me to challenge myself and do extra research into how to make it work while following this tutorial. Reasonably hard challenge but fun to do (and possible).
@arsenicrx684
@arsenicrx684 11 ай бұрын
Hi, by any chance can you explain how or where I can find the information to add all the x and y directions as I'm struggling
@1Chitus
@1Chitus Жыл бұрын
Thank you so much for uploading such a high quality tutorial for free! Very succinct and well explained, I’ve learned tons.
@paaulsens6086
@paaulsens6086 Жыл бұрын
Small tip for everyone, after implementing the CinemachineVirtualCamera, if your animations/movement is still choppy/laggy/buggy: Above your view, where you change aspect ratio, click on it and enable VSync. This fixed it for me.
@胡詠傑-v3s
@胡詠傑-v3s Жыл бұрын
Big love to u.This course is extremely useful!
@redfactionofficial
@redfactionofficial Жыл бұрын
If people experience a issue with the sword hitbox not disabling after the end of the animation, try adding: public void StopAttack() { attack_Sword.StopAttack(); } to playercontroller and a event on the end of the attack animation to call stopattack
@paaulsens6086
@paaulsens6086 Жыл бұрын
Thank you
@FTZPLTC
@FTZPLTC 5 ай бұрын
Yeah, this is confusing: does the tutorial go out of sequence or something?
@Potatowo
@Potatowo Жыл бұрын
A wonderful guide to say that least, perfect for beginners, it is quite user friendly thank you for releasing it!
@xus9380
@xus9380 2 жыл бұрын
47:50 if you dont have samples to change 60 to 10 , just click at the second bottom 3 dots at the right side animation tab and choose Show Sample Rate ;D
@yancur
@yancur 2 жыл бұрын
thanks!
@rioranggayudhasaragih6931
@rioranggayudhasaragih6931 2 жыл бұрын
Ima download it thanks for sharing!!
@garlicat878
@garlicat878 2 жыл бұрын
This video is a good start for setting up a 2D game in Unity. Really informative.
@prism_schism
@prism_schism Жыл бұрын
AMAZING tutorial! That being said, I believe the movement script is calling the key press TWICE for every press, which in turn causes movement stutters when moving around the map. Apparently, this happens fairly often to people.
@Exploshi
@Exploshi Жыл бұрын
how do i fix this
@bedirhanyelkovanc5422
@bedirhanyelkovanc5422 2 жыл бұрын
Best tutorial ive evr seen bro ur d best!!!!!
@scottev954
@scottev954 2 жыл бұрын
I appreciated the explanation of the newer Player Input Component. I'll no doubt use this script for my basic 2D characters in the future. Very easy to follow and understand, thanks!!
@niicholls3682
@niicholls3682 2 жыл бұрын
Great video and at a comfortable pace. Will you be adding any more parts to this series?
@uziwrld
@uziwrld Жыл бұрын
Everything worked till attack slime part. 6/10 tutorial, i still learned quite alot and explanations were clear. If anyone plans on doing this course just know it will take atleast 2-3 hours
@JimmyYaoDev
@JimmyYaoDev Жыл бұрын
I had this same issue, but fixed it when I realized that when subtracting the enemy's health, you have to use "enemy.Health -= damage", not "enemy.health -= damage". It's case-sensitive. If that was your issue, hope this comment helps!
@nacennos9020
@nacennos9020 5 ай бұрын
38:00 - Player Doesn't Move If your code is completely correct, go back a few minutes with recording. Go to unity and on the left side of the screen, find Player. Check the right side of the screen where the player parameters are located. Go to Player Input --> Actions and check if it is set to ,,None". If so, create an action. The action must be set or the character will not move. 58:25 - Blurred Player While Moving Look at the left side of your screen. In Hierarchy window go to Main Camera --> Inspector (on the right side) --> CinemachineBrain --> Update Method. Change from Smart Update to Fixed Update.
@zaidynsorenson6375
@zaidynsorenson6375 2 ай бұрын
So my player moves but upon colliding with an object i just freeze rather than being about to move in a rigid way or slide along the fence. I just cant move in general and i dont know how to fix it
@壽也
@壽也 10 ай бұрын
finally finished the tutorial this is my first time that making a TopDownGame.For those who struggle at 1:20:00 the player sprite is always under the Slime sprite,just change the slime's z position in transform bigger than 0,(I set it as 0.1),if the sprite disappear,it might be the problem from camera.Thanks for your tutorial it help and inspire me a lots.
@Montigorable
@Montigorable 10 ай бұрын
Thanks for the comprehensive tutorial. By the way, at 42:11, rb.Cast() automatically works with every GameObject and its children that have colliders or triggers. If you have multiple colliders but want to use only one, you can declare the required collider and use yourCollider.Cast() instead of rb.Cast().
@enghasanm
@enghasanm 2 жыл бұрын
This was amazing tutorial, as others mentioned, all the walkthrough worked for me, only thing is the frames samples in the controller was not showing on my end, had to enable it, beside that, everything else worked as explained, Thank you so much for the free assets also, it is rare to find creators giving away assets for free, you are amazing. Hope you upload part II, where you have the mobs attack and move around as you mentioned.
@KoalaOnYT_
@KoalaOnYT_ 2 жыл бұрын
how did u enable frame samples
@Exhille
@Exhille 2 жыл бұрын
@@KoalaOnYT_ on the animation window to the left there are three dots (to the left of a lock), below those 3 dots there are additional 3 dots (that's where you enable sample rate)... took me a long time to figure that out.
@random.oddities
@random.oddities Жыл бұрын
Looks like a great tutorial! I can't wait to get back into some Unity projects.
@Itzaric
@Itzaric 2 жыл бұрын
Following this tutorial gives me that same giddy excitement I had in primary school learning addition and subtraction. I think that was the last time I was ever excited about learning lmao
@zatzu
@zatzu Жыл бұрын
I made it to the end! Thank you for the tutorial
@prestonthorniley
@prestonthorniley 6 ай бұрын
Awesome tutorial, really helped me get off the ground using unity. I will advise new developers such as myself to REMEMBER that you disabled the 'Reload Domain' (39:57) it was causing strange issues for me later on and took me a while to relocate that option and track it down as an issue.
@bcyayay
@bcyayay 2 жыл бұрын
This deservers a lot more praise
@finna7824
@finna7824 2 жыл бұрын
steller video. You both explain what you are doing and show how to do it perfectly, I always felt like I knew what was happening and could follow along easily. You are a really talented teacher!
@wayfaringnemophilist
@wayfaringnemophilist Жыл бұрын
The way you wired up movement on the player is a fairly verbose way of going about collisions when you're using a RigidBody2D. For those wanting a far smoother and easier solution, especially using the new Input System, go to the Player RigidBody2D in the Inspector, change Body Type back to Dynamic, go to Constraints and Freeze the Z axis, and set the Gravity Scale to 0. Then in FixedUpdate, all you need is: private void FixedUpdate() { rb.velocity = movInput * MoveSpeed * Time.fixedDeltaTime; } You can also change the BoxCollider2D to a CapsuleCollider2D for smoother transitions when sliding along other collision objects. Make sure to set the CapsuleCollider2D's Direction to Horizontal. Otherwise, great tutorial so far.
@KrustyKomrades
@KrustyKomrades Жыл бұрын
Fully recommend switching the RigidBody2D body type to Dynamic instead of kinematic and using the capsule collider2d instead of the box collider 2d. My character kept getting stuck after colliding with an obstacle. Switching from Kinematic to Dynamic body type on the player prefab worked for me, but the capsule collider is just future-proofing best practice.
@VoidOnyx35
@VoidOnyx35 Жыл бұрын
You cannot adjust the hitbox box collider by the 4 points. if you do it will change the offset of it rather than the position and then when you try to attack left it will not work because you have the offset changed. Just adjust with the Transform options and make sure offset is at 0 for X and Y.
@Devcutter
@Devcutter Жыл бұрын
thank you sir !
@UnhingedSystems
@UnhingedSystems 11 ай бұрын
Great crash course! Thank you!
@lexecutive
@lexecutive 10 ай бұрын
Thank you, Chris, for this awesome tutorial. Completing it definitely took a while. Next time, it would be great if you could indicate which lines you'll be fixing/modifying.
@lidogCaine
@lidogCaine 10 ай бұрын
Player controller Script doesn't work, don't know what I'm doing wrong, I checked everything
@ashaneperera6768
@ashaneperera6768 7 ай бұрын
Gay
@lyuboslavnemtsov8417
@lyuboslavnemtsov8417 2 жыл бұрын
Love the explanation! Great work! Keep up the good tutorials!
@eddielicea3740
@eddielicea3740 2 жыл бұрын
If anyone is having jittery game character movement just go to the rigidbody2d component and set interpolate to interpolate :)!
@caydencobb9973
@caydencobb9973 2 жыл бұрын
Thanks so much dude!!
@EnderKhaos
@EnderKhaos Жыл бұрын
Thanks for the help my man
@xxMpEGxx
@xxMpEGxx 2 жыл бұрын
maybe another explanation to fixed delta time: some processors are faster than others so to reach the same distance in the same time on a faster and a slower computer (otherwise players with a faster processor would have an advantage in games) we need to slow down the speed of the character on a faster computer and speed it up on the slower computer, which is achieved by multiplying the movementSpeed with a factor that describes the time difference between 2 frames of the game = fixedDeltaTime (the greek letter delta is used for differences in math, not sure what "fixed" stands for) example: take movementSpeed = 1 the slow computer takes 1.5 seconds between frame1 and frame2 (very exaggerated example, I know) therefore we get: 1 * 1.5 = 1.5 now take the fast computer it takes just 0.2 seconds between frame1 and frame2 therefore we get: 1 * 0.2 = 0.2 so we have sped up the character on the slower computer and slowed it down on the faster computer but they will both reach the same distance in the same time interval
@isaackeller90
@isaackeller90 Жыл бұрын
Great tutorial thanks for your hardwork!
@BenFuller321
@BenFuller321 2 жыл бұрын
This was a great tutorial, good to have one that focuses on this kind of 2D style game that's up to date for Unity in 2022. I've faced so many issues with some of the Brackeys stuff because it's just simply out of date. But we need a part 2 to this, there is a lot left unanswered. How do we get Enemys to chase and attack for instance?
@szymon200000
@szymon200000 2 жыл бұрын
great tutorial! just the right amount of information
@t90gamemakervietnam8
@t90gamemakervietnam8 Жыл бұрын
Thanks for your tutorials, it helps me a lot!
@OldSkoolSP
@OldSkoolSP 2 жыл бұрын
Quick note: I'm running Unity 2021.2.16, and Cinemachine has its own menu at the top between "Component" and "Window", in case anybody is wondering why it doesn't appear under the "GameObject" menu.
@sebrukai3337
@sebrukai3337 2 жыл бұрын
Thank you so much!
@technicalkhan4636
@technicalkhan4636 2 жыл бұрын
I am very glad that I stumbled upon your video
@JOEMface.
@JOEMface. 2 жыл бұрын
For anyone having trouble with doing damage while standing still: If you go to your Slime prefab -> RigidBody2D -> change "Sleeping Mode" to Never Sleep, collision works standing or moving!
@mastjaso
@mastjaso Жыл бұрын
Thank you!!! ❤🧡💛💚💙💜🤎🖤🤍
@theanimationstation9644
@theanimationstation9644 2 жыл бұрын
Was a good video,I mean I wasn’t able to follow but not without stopping the video, how did you learn coding? You have gained a sub The amount of work that you have put in is outstanding👏🏻
@Andrew_Videos
@Andrew_Videos 2 жыл бұрын
ty for this tutorial, very helpful and much appreciated :)
@griffinbrooks6748
@griffinbrooks6748 2 жыл бұрын
Bro is saving my butt during a game jam. when i watch number 2 my game will almost be done.
@miaoumixed4268
@miaoumixed4268 2 жыл бұрын
A little suggestion: Using a Collider2D.Cast() instead of the Rigidbody2D.Cast() because the latter checks for all the colliders attached to the gameObject even the children colliders; but the Collider2D.Cast() has a parameter (bool) to ignore all other colliders even children colliders so the sword collider (for example) can be completely ignore which avoid bugs. Also use Layers and the Project Setting - physics 2D layer matrix to control all the collisions player/sword/collision/enemy/CinemachineConfiner and so on. M. D.
@prism_schism
@prism_schism Жыл бұрын
How is this done in script???
@dontdiepeppe
@dontdiepeppe Жыл бұрын
How???
@zapleaf
@zapleaf 2 жыл бұрын
attackRightOffset = transform.localPosition; If you are not applying a local position you're inheritly applying a global position, which will cause the sword attack hitbox to just move all over the "World" instead of within the scope of the player's position.
@mrbrasko7221
@mrbrasko7221 2 жыл бұрын
Thank you was driving me crazy. So simple but huge bug fix.
@mirrormirror6210
@mirrormirror6210 Жыл бұрын
Thank you. I was trying to fix it in the past one hour and decided to check the comment of the video. Thanks a lot for providing the solution.
@zapleaf
@zapleaf Жыл бұрын
@@mirrormirror6210 I got cha bro ;)
@ahreg3417
@ahreg3417 Жыл бұрын
You are literally a legend. I have probably spent 2 hours trying to work something out that didn't involve completely changing my code.
@FCO1988
@FCO1988 Жыл бұрын
te quiero bro haha thank you so much
@fahmimohamadramadhan3978
@fahmimohamadramadhan3978 2 жыл бұрын
Really nice job. I did so stuff with MIDI/DAW/soft banks wayyy back in like 99/00 in college and was ok at it. I bought soft soft last
@stevensheng7
@stevensheng7 2 жыл бұрын
Excellent tutorial!
@snowman7487
@snowman7487 Жыл бұрын
This is honestly the best Unity 2D intro on the internet - it covers a lot in a short time, is completely understandable - you see every click - and was a basis on which I could expand and develop additional features (e.g. different 4 directional sprite animations) just based on what I learned here and figuring out the rest. I've tried long paid for classes on training websites and found them hard to follow or their verson of unity wasn't relevant to the most recent updates. I'm hugely grateful to @Chris'Tutorials for making it. Moved me forward so much!
@randywilliams6248
@randywilliams6248 2 жыл бұрын
Great video, thank you! This is great for an artist like myself!
@hoangleminh2424
@hoangleminh2424 2 жыл бұрын
great tutorial and detail step by step thanks
@thodorisevangelakos
@thodorisevangelakos 5 ай бұрын
Don't use the pixel perfect camera component if you're using the pixel perfect extension. The entire point of the latter is to not have to use the former. For example, both cinemachine and pixel perfect camera change the Camera's ortho (aka the zoom), so if you try and make a zoom functionality like I did you'll end up with 2 different components fighting for control of the ortho
@floweringmind
@floweringmind Жыл бұрын
If you character keeps attacking after clicking. Make sure you haven't assigned an event when going back to idle state.
@eriyagames
@eriyagames 2 жыл бұрын
Great video!
@marcinbarczynski7784
@marcinbarczynski7784 2 жыл бұрын
I actually found a problem with this: if you set the damage to be smaller than the enemy's health, then only the first attack will deal damage. Following attacks without moving will consider the enemy as having entered the trigger previously and not entering it again. You have to perform at least one attack which will place the enemy outside the hitbox before your attacks against that enemy will work again.
@Voltcha
@Voltcha 2 жыл бұрын
Did you ever find the solution to this?
@fraserkemp1127
@fraserkemp1127 Жыл бұрын
Same for me. awesome tutorial though gotta say.
@clykke
@clykke Жыл бұрын
@@Voltcha Did you? I have the same problem
@SoultrailStudio
@SoultrailStudio 10 ай бұрын
It's quite a while ago, but I find this very usefull coming from other engines that was easy to follow. Yet to continue there is stuff to learn that a newbe cannot properly formulate to find the right tutorials for. Stuff like persistant storage of information (for inventory or player stats) and having different scenes to go from to.
@Jackwebb97
@Jackwebb97 2 жыл бұрын
Great tutorial! I found it very easy to follow along, however I found that when following the coding for the player controller when it compiled I don't have the movement filter and the debugger for unity is no longer being maintain, so I cannot use that to fix it.
@SMO_Nik_0475
@SMO_Nik_0475 10 ай бұрын
at 35 mins it doesent show me the options for the Player Controller like movespeed collision offset etc.
@pyguy4594
@pyguy4594 2 жыл бұрын
I am at 44:30 and after testing movement my character is becoming stuck on the fences. I have tried giving the player a circle collider instead and that did not work.
@think-IT42
@think-IT42 2 жыл бұрын
changing : moveSpeed * Time.fixedDeltaTime * collisionOffset); to : moveSpeed * Time.fixedDeltaTime + collisionOffset); on line 44 helped me solve it.
@Godflay
@Godflay 2 жыл бұрын
@@think-IT42 this is the way
@sleepy9809
@sleepy9809 2 жыл бұрын
Hey, you might have already forgot about this tutorial, but what was causing this issue for me was a line in the TryMove function. Make sure it is exactly like this: if (count == 0) { rb.MovePosition(rb.position + direction * moveSpeed * Time.fixedDeltaTime);
@etclee6630
@etclee6630 2 жыл бұрын
@@think-IT42 thanks! this fixed my stucking problem!
@romeprince11
@romeprince11 2 жыл бұрын
@@sleepy9809 THANK YOU THIS was the fix
@TRGantz
@TRGantz Жыл бұрын
58:30. Great tutorial so far!
The Ultimate Pixel Art Tutorial
14:15
Saultoons
Рет қаралды 1,6 МЛН
كم بصير عمركم عام ٢٠٢٥😍 #shorts #hasanandnour
00:27
hasan and nour shorts
Рет қаралды 11 МЛН
Why no RONALDO?! 🤔⚽️
00:28
Celine Dept
Рет қаралды 97 МЛН
За кого болели?😂
00:18
МЯТНАЯ ФАНТА
Рет қаралды 3,4 МЛН
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,2 МЛН
Creating SMART enemies from scratch! | Devlog
5:40
Challacade
Рет қаралды 362 М.
Godot 4 Crash Course for Beginners - GameDev 2D Top Down Tutorial
1:13:34
Chris' Tutorials
Рет қаралды 387 М.
Technique for Creating Beautiful Level Design
11:48
Pixel Architect
Рет қаралды 899 М.
I Wish I Had Known This Before I Started Unity Game Development...
11:11
The Trick I Used to Make Combat Fun! | Devlog
8:12
Game Endeavor
Рет қаралды 1,7 МЛН
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,6 МЛН
Optimizing my Game so it Runs on a Potato
19:02
Blargis
Рет қаралды 661 М.
7 DEVS Make a GAME without COMMUNICATING! (centipede edition)
17:16
Blackthornprod
Рет қаралды 1,2 МЛН
1 Year of Learning Game Development In 6 Minutes
6:01
Giedzilla
Рет қаралды 2,5 МЛН
كم بصير عمركم عام ٢٠٢٥😍 #shorts #hasanandnour
00:27
hasan and nour shorts
Рет қаралды 11 МЛН