Brackeys 2D Movement and Melee Combat Tutorials - 2D Movement

September 30, 2020

Unity

2D Movement


Title: 2D Movement in Unity (Tutorial)
By: Brackeys
Youtube - Tutorial #1
Description: Tutorial for using a simple Unity player controller.


Title: MELEE COMBAT in Unity
By: Brackeys
Youtube - Tutorial #2
Description: Tutorial for setting up basic melee combat with a 2D player controller.


Overview

I started with the Melee combat tutorial but it referenced the movement tutorial for how they setup the starting movement and animation so I wanted to move back to them just to make sure I was starting in a similar spot. The player controller made in the 2D movement tutorial is actually pretty bad unfortunately, but I still wanted to use this melee combat tutorial as a base point for something that is workable but not amazing just to get an idea of how to approach combat.

2D Player Movement - Tutorial #1

While overall not a great tutorial, it did support some concepts I have come across. They separated the player input functionality and the actual movement application into the Update and Fixed Update methods respectively, which is a solid approach I have seen more and more in my search for information on player controllers now. However, all of the Fixed Update work was basically already done in a Player Controller script they gave you, so it really just covered programming the script responsible for receiving player input and passing it on to the movement logic.

To make matters worse, the given script does not even work particularly well. Its checks for the ceiling and the ground can give weird results unless at good ranged values which can prevent your player from crouching or jumping, or getting out of crouch at times. Then when air control is turned on, there is a bug where the character automatically crouches in midair (which removes their upper hitbox) simply from them jumping into objects as the ceiling sensor activates and automatically makes them crouch in the air.

I was able to fix the midair crouching bug by adding an extra check in the tutorial given script to also ensure the player was grounded before making crouch true. This led to another interesting aspect of the tutorial with the separation of input and actual player movement because the movement was receiving information from the input such as "is crouch being pressed" and then would use that information and check the surroundings (such as if they are under a ledge) to determine whether they could actually move out of crouch or not. This was just an interesting way of separating the input logic from the actual player control logic and is good to keep in mind for an input buffering system.

After fixing the bugs and messing with adding some animation similar to what they already have at the start of the melee combat tutorial, I did not have time to move on to that one. I will look into completing that next with my decent player controller in place now with most of the animations.

Comments

Popular posts from this blog

Online Multiplayer Networking Solution Tutorial Using Unity and Mirror - Tutorial by: Jason Weimann

Exporting FBX from Houdini with Color

Houdini Assignment - Fuse and Group