Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question Trouble with combat

Discussion in 'Scripting' started by LazyGhost15, May 18, 2024.

  1. LazyGhost15

    LazyGhost15

    Joined:
    Feb 12, 2022
    Posts:
    122
    I am making a 3D game with 2D characters, something like Octopath Traveler 2 (Like the same idea of 2.5D) and I am having trouble with the combat in the game. Unlike Octopath I don't want my game to have the turn-based RPG kind of system, but top-down combat like CrossCode with different weapons to equip, special skills, etc.

    But I got stuck figuring out how I even make my player to attack. In 3D I can animate the objects, moving them around. But when the character is 2D I get stuck. Any tips or helpful tutorials?
     
  2. jmancoder

    jmancoder

    Joined:
    Feb 21, 2022
    Posts:
    9
    It's actually much easier, in a sense. It's just 2D sprites in a 3D world. Check out this Unity Learn tutorial. You can use a basic image editor like Paint to make the images for each animation, just be sure to check the following setting when you import the art:
    • Sprite Import Mode = Multiple
    • Pixels Per Unit = 16 or 100, depending on how you scale things
    • Filter Mode = Point (no filter)
    • Compression = None
    If you Google it, there should be quite a few tutorials on making 2D animations and pixel art in Unity.
     
  3. LazyGhost15

    LazyGhost15

    Joined:
    Feb 12, 2022
    Posts:
    122
    I think I struggle more with how am I even making a weapon to "attack". Should I use colliders? Do they(colliders) need to move? Do I need to animate them differently? This is what I am really stuck about
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,388
    These are all legitimate ways to accomplish combat. There's many more ways too.

    This is the problem with overanalyzing: nothing gets learned.

    Get something up, get something working, even if it's a single sprite dude with an invisible sword that sweeps in front of it and damages the things it overlaps.

    For inspiration go to Open Game Art and grab a dude, don't even think about the animation, just grab his "standing" frame, and same goes for a bad guy. Or take the dude and write BAD on him with an image editor, drop it in, get it moving around. For AI on the bad guy, just make him stand still for now and have a health amount of 1. Now get to work with a simple overlap test to damage.

    You will learn SO MUCH just doing that simple process!!

    Stop making excuses!