How to Make a 2D Melee Attack | EASY Unity Tutorial

Ойындар

Show your Support & Get Exclusive Benefits on Patreon (Including Access to this project's Source Files + Code) - / sasquatchbgames
Join our Discord Community! - / discord
By the end of this unity tutorial, we'll have our character damaging enemies using a scaleable 2D melee combat system, where you can control the EXACT timing of when damage is applied to enemies based on the animation of your attack (giving you full control.)
I'll also show you how to include Gamepad support, because using the keyboard sucks!
Link to Download the FREE 2D Asset Pack seen in this tutorial:
veilofmaia.com/tutorial-asset...
---
In need of some Unity Assets? Using our affiliate link is a great way to support us. It's free, and we get a small cut that helps keep us up and running: assetstore.unity.com?aid=1100lwgBQ
---
Contents of This Video: ------------------------------------------
00:00 - Setup and Import
02:30 - Starting to Code the Attack
05:34 - Implement Damage Interface
09:35 - Creating the Attack Animation
12:57 - Implement Time Between Attacks
14:15 - Redoing the Attack Properly
17:22 - Fixing the Damage Function
Who We Are-------------------------------------
If you're new to our channel, we're Brandon & Nikki from Sasquatch B Studios. We sold our house to start our game studio, and work full time on building our business and making our game, Veil of Maia.
Wishlist our Games:
Wishlist Samurado on Steam! - store.steampowered.com/app/23...
Wishlist Veil of Maia! - store.steampowered.com/app/19...
Don't forget to Subscribe for NEW game dev videos every Monday & Thursday!
Follow us on Twitter for regular updates!
/ sasquatchbgames
#unitytutorial #unity2d #platformer

Пікірлер: 19

  • @sasquatchbgames
    @sasquatchbgames Жыл бұрын

    Improvement Note: In the DamageSlash Coroutine, the check: if (iDamageable != null && !iDamageable.HasBeenDamaged) can be changed to: if (iDamageable != null && !iDamageables.Contains(iDamageable)) - this will allow you to delete the HasBeenDamaged bool from the iDamageable interface (you'll need to get rid of it in the enemy Damage functions as well,) AND - this will allow you to get rid of the foreach loop that runs after the coroutine is finished (but the list still needs to clear) Faster and easier to read/implement this way.

  • @shockingchris9809
    @shockingchris98097 ай бұрын

    It needs to be stated, while other systems show a simple approach to do something (create a collider and connect colliders, etc) the system you show feels very robust and the various additions, while they add some scripts and functions for checks, are a diamond in the rough as far as going all the way to show the full implementation, not just the face layer of something like an attack. Your state machine videos were testament to that. I am reworking my attack system and while I plan to do implement a touch different (top down 2D), the thoroughness that goes into these videos is not unnoticed. 👌This should be a 500K sub channel. Someday.

  • @gabrijel9129
    @gabrijel9129 Жыл бұрын

    Excellent tutorial, keep them coming!

  • @Notreal76
    @Notreal76 Жыл бұрын

    Good tutorial. Thank you.

  • @sasquatchbgames

    @sasquatchbgames

    Жыл бұрын

    Glad you liked it!

  • @akael8350
    @akael83507 ай бұрын

    Thanks for the tutorial, in particular with the while and animation event in the coroutine attack. Just a question. My attack have a vfx effect with particle (I use a prefab with the texture sheet animation). Is it possible to launch the script with a particle event to replace the animation frame event ?

  • @briantrochim474
    @briantrochim4743 ай бұрын

    For ideas, Top down mouse directional melee combat would be cool. the code monkey guy has one but its hard to follow and he leaves alot out of it.

  • @playdark33
    @playdark33 Жыл бұрын

    good

  • @fullcotonalchimist9714
    @fullcotonalchimist97145 ай бұрын

    you write and change window so freaking fast that i need to rewatch the last minute every minute...At least that's good for the timewatch of the video 😭😭

  • @juandavidriossanchez5298
    @juandavidriossanchez52988 ай бұрын

    Bro i have a problem: PlayerAttack.cs(16,12) error : The name "User Input" does not existe, in the current context. Do you have any idea on what could i do? thanks

  • @Sgt_Killersnow

    @Sgt_Killersnow

    Ай бұрын

    This looks like you might not have switched to the Input System and made a script called User Input to control what button maps and control schemes your project will use and when. I'd recommend watching his video going over the Input System! his script names change a bit between videos so I think he starts it off as PlayerInput and then later it becomes User Input, etc etc.

  • @BrandonChT
    @BrandonChTАй бұрын

    says its easy and here I am 3 hours later finding out that this sht aint working for me and just quit!

  • @Coco-gg5vp
    @Coco-gg5vp Жыл бұрын

    First

  • @sebastianhall8150

    @sebastianhall8150

    Жыл бұрын

    First on this comment

  • @wabbit_07

    @wabbit_07

    Жыл бұрын

    @@sebastianhall8150 First reply to this reply on this comment

  • @sasquatchbgames

    @sasquatchbgames

    Жыл бұрын

    First to reply to the reply to this reply on this comment

  • @Coco-gg5vp

    @Coco-gg5vp

    Жыл бұрын

    What have I started

  • @redrad14

    @redrad14

    Жыл бұрын

    Not first

Келесі