How To Melee Attack From Hollow Knight

  Рет қаралды 19,222

I_Am_Err00r

I_Am_Err00r

Күн бұрын

This tutorial will go over all the features to have a melee combat and exploration system as featured in Team Cherry's very popular (and fun) 2D action platformer 'Hollow Knight'
I've uploaded all the scripts discussed in this tutorial to my GitHub page github.com/I-Am-Err00r/Melee-...
It is highly recommended you copy those scripts and watch this tutorial to understand how the logic flows. This solution does require that your project have the ability to know when the player is grounded or not (which is a very common and rather necessary feature to have in most platforming solutions), but assuming you have your own way of managing the grounded state for the player, there is nothing that you would need to watch from any of my previous tutorials uploaded to KZbin. If you want to have a more exact solution as I present in this video, here are the other tutorials in which I discuss features and Unity tools that are shown in this tutorial:
Total Jump Solution: • Total Jump Solution: L...
Sprite Face Direction Of Movement: • How To Have Sprite Fac...
Total Animation Solution: • Total Animation Soluti...
Visit my playlist that goes over all the previous episodes to this one: • Popular 2D Platformer ...
Also, if you're planning on making a Metroidvania or 2D action platformer, consider taking a look at my course on Udemy, click this link for a discount to the course: err00rfree.com/metroidvania-t...
Credit: Team Cherry for Hollow Knight:
store.steampowered.com/app/36...
store.playstation.com/en-us/p...
www.xbox.com/en-US/games/stor...
www.nintendo.com/games/detail...
0:00 Intro/Memes
1:35 Notes On What This Solution Covers
4:15 New Scripts And Detailed Code Explanation
18:45 Player IK Animations And How To Animate Melee Swipe
27:41 How To Manage Animations Through Animator
33:55 Playtest And Outro

Пікірлер: 39
@blackheartgaming6121
@blackheartgaming6121 Жыл бұрын
Love how you set up the video
@pmshe8273
@pmshe8273 2 жыл бұрын
this channel is a gold mine. Thank you so much for making these!
@IAmErr00r
@IAmErr00r 2 жыл бұрын
Thanks for that! Definitely means a lot! I always try to make my solutions as user friendly as I can.
@ramsesgonzalez8853
@ramsesgonzalez8853 Жыл бұрын
I recently got into unity and MetroidVania games (specifically HollowKnight) is what inspired me so I want to attempt to do a game like this and this I see that this channel is going to be of hreat help! Well appreciated!
@IAmErr00r
@IAmErr00r Жыл бұрын
Thanks! I’m hoping to get back into tutorials soon, had to take a full time job starting this year and took a break
@mayankbhaisora2699
@mayankbhaisora2699 2 жыл бұрын
You explain everything very well. Keep it up man. Just came across your videos and they are very good. Please keep making unity videos.
@IAmErr00r
@IAmErr00r 2 жыл бұрын
Thanks, this really does mean a lot. I try to only upload videos that don't already have good solutions as well as solutions that are modular and able to be plugged into any project, so the challenge for me is finding a feature that doesn't already have tons of useful resources already as well as a feature that wouldn't require you to follow my exact solution from previous videos. Suggestions are always welcome, but I tend to stick to 2D features.
@mayankbhaisora2699
@mayankbhaisora2699 2 жыл бұрын
@@IAmErr00r Nice… I am all up for 2D solutions. Will surely drop comments for which I find it hard to get solutions. Thanks 🖤
Жыл бұрын
Best tutorial ever love you man
@seemabansal7298
@seemabansal7298 2 жыл бұрын
This channel definitely deserves more subscribers
@IAmErr00r
@IAmErr00r Жыл бұрын
Hey! I appreciate this! I’m hoping to find the time to do more tutorials soon, I’ve been so busy this whole year
@MrEastgalaxy
@MrEastgalaxy Жыл бұрын
New Golden standard, going buy course for sure
@blackheartgaming6121
@blackheartgaming6121 Жыл бұрын
Can’t wait to get my gaming desktop soon so I can start making games again unity and unreal I’m going to use both again
@IAmErr00r
@IAmErr00r Жыл бұрын
I’ll reply to both of your comments here, but thanks so much for your feedback. I’m hoping to get back into these soon!
@hfg16
@hfg16 Жыл бұрын
Bro this is a fk tu Tutorial explaining the logic of everything even the code how he check with other cods and how everything is operating bro please continue u are a beast ❤️❤️❤️❤️🎬
@IAmErr00r
@IAmErr00r Жыл бұрын
Really appreciate this! It’s been a while since I checked my channel and comments like this really make me want to pick this up again soon!
@kenneth5095
@kenneth5095 25 күн бұрын
How do I fix the error cant add (any of the 3 scripts) because scripts class cannot be found
@enterex_
@enterex_ 2 жыл бұрын
Very nice tutorial! I had an issue where when I go to nail jump while jumping or holding space it would do what I assume is add or multiply the jump force and upwards force and my character would go flying instead of doing a small nail jump. If anyone can think of a solution thanks in advance.
@IAmErr00r
@IAmErr00r 2 жыл бұрын
Hey, sorry for the late reply. I have a video that I made that goes over the jump I use for this character; in that script I limit the maximum y velocity for the rigidbody that runs in FixedUpdate. All my scripts are posted on my GitHub page, so you can look there to get an idea if you have a jump solution you don’t want to replace.
@longnon248
@longnon248 7 ай бұрын
can i have full of the code
@hangel22
@hangel22 2 жыл бұрын
Good content
@IAmErr00r
@IAmErr00r 2 жыл бұрын
Thanks! I was kind of surprised when I saw nobody had already made a similar tutorial.
@Solbast
@Solbast Жыл бұрын
can you do a video about enemy and player health?
@IAmErr00r
@IAmErr00r Жыл бұрын
Hey! I actually did one already I think, check my channel and there is a video about damage and knockback
@0whatman
@0whatman Жыл бұрын
I've been trying to adapt this to a 2.5D game, but for some reason it seems to not connect with the enemies I change all the code for the 3D and it shows no errors or the like, so idk what the problem is
@IAmErr00r
@IAmErr00r Жыл бұрын
You need to make sure all the colliders used in Unity are 3D as well as using the 3D references to these in your code (it sounds like you did that second part already though) Let me know if you’re still having trouble
@0whatman
@0whatman Жыл бұрын
@@IAmErr00r I did do all of that I've been trying to do with (a crap I cant remember the name rn, it's super late and I'm boutta sleep lol) the thing that like goes arround the body to make the hitbox instead of using pills and cubes and such but I also tried it with those and it didnt work, I know they require some differences in code and I made those changes
@kenneth5095
@kenneth5095 25 күн бұрын
You're a g
@aryanshrivastava4733
@aryanshrivastava4733 Жыл бұрын
CS0023 Operator '!' cannot be applied to operand of type 'method group' CS0019 Operator '&&' cannot be applied to operands of type 'bool' and 'method group' how to fix these 2 ?
@codemtv4314
@codemtv4314 6 ай бұрын
you just need to but a () in fronz the method group so for example isGrounded() instead of isGrounded
@foxi7463
@foxi7463 Жыл бұрын
Somehow my rigidbody stopped working and i'm stuck in the air.
@IAmErr00r
@IAmErr00r Жыл бұрын
Hey, sorry about the delay, but want to provide some help if you’re still needing it
@adrianfelix4518
@adrianfelix4518 Жыл бұрын
I was able to fix most of my problems but now the only thing is that my enemies don't take damage, I get this error whenever I try to attack them (NullReferenceException: Object reference not set to an instance of an object, MeleeWeapon.HandleCollision (EnemyHealth objHealth) (MeleeWeapon.cs:67)) if you could tell me what this error means and how to fix it, I'd greatly appreciate it.
@IAmErr00r
@IAmErr00r Жыл бұрын
It sounds like the enemy might not have an EnemyHealth script on the enemy that could run the damage method; if you have your own health script on your enemy, you will need to change the reference to the EnemyHealth script within the MeleeWeapon script to whatever you named the health script on your enemies. Let me know if this makes sense or helps you out.
@adrianfelix4518
@adrianfelix4518 Жыл бұрын
@@IAmErr00r I completely copied every piece of code and changed anything that needed to be changed, and my enemies have the EnemyHealth script attached. Could it be some other issue that I just don't know about?
@IAmErr00r
@IAmErr00r Жыл бұрын
A null reference error usually means you are trying to access a variable or method in a script on a gameobject and that script isn’t found on the gameobject you are trying to interact with. Your error is saying that the MeleeWeapon script is running the HandleCollision method; that method sets the direction of the hit, then runs the Damage method on the EnemyHealth script, then last runs a quick coroutine to make sure the melee attack only registers one hit per strike. Unless I’m not seeing something in my code, your enemy doesn’t have the EnemyHealth script I provide in this video or you renamed my script and aren’t referencing it correctly; maybe you have another script named EnemyHealth and renamed the script I provide, if that is the case then you need to reference the renamed script in the parenthesis at the top of the method.
@Dukykitsune
@Dukykitsune Жыл бұрын
@@IAmErr00r I have the same problem I have tried everything but nothing works. When I hit an enemy with the script the game crashes with the error NullReferenceException: Object reference not set to an instance of an object MeleeWeapon.HandleCollision (EnemyHealth objHealth) (at Assets/Scripts/MeleeWeapon.cs:69) MeleeWeapon.OnTriggerEnter2D (UnityEngine.Collider2D collision) (at Assets/Scripts/MeleeWeapon.cs:45)
@sandeez886
@sandeez886 Жыл бұрын
i get this error: MeleeAttackManager.cs(37,29): error CS0115: 'MeleeAttackManager.Initializtion()': no suitable method found to override
@sandeez886
@sandeez886 Жыл бұрын
nvm
Fighting your Foes  - A guide to Hollow Knight's Combat
18:16
Brandflakes Inc.
Рет қаралды 3,7 М.
The Animation of Hollow Knight
11:36
Video Game Animation Study
Рет қаралды 241 М.
Каха с волосами
01:00
К-Media
Рет қаралды 6 МЛН
Зу-зу Күлпәш. Агроном. (5-бөлім)
55:20
ASTANATV Movie
Рет қаралды 569 М.
5 tips for better platformer controls
5:22
The Shaggy Dev
Рет қаралды 168 М.
Improve your Platformer’s Jump (and Wall Jump) | Unity
8:12
The Effects Animation of Hollow Knight
7:19
New Frame Plus
Рет қаралды 345 М.
2D Art Basics Webinar + LIVE Q&A
1:13:20
Thomas Brush
Рет қаралды 25 М.
Escaping Unity Animator HELL
18:18
Lost Relic Games
Рет қаралды 490 М.
I Made Hollow Knight but it's Pixel Art
7:47
GamesWithFredi
Рет қаралды 99 М.
How 2D Fighter Games are Animated
7:13
Video Game Animation Study
Рет қаралды 366 М.
How I made an Excellent Platformer
8:25
GoldenEvolution
Рет қаралды 246 М.
Clash Of Clans X Haaland Troll Face Edit🔥☠️ | #shortsvideo #capcut
1:00
СКРАФТИТЬ БЕДРОК - ЛЕГКО✅
0:32
ВЛАДУС
Рет қаралды 2,7 МЛН
Minecraft herobrine meme
1:01
Daquavis
Рет қаралды 17 МЛН