Walk, Idle, and Turn Around: Action RPG in Unity Tutorial #2

Поділитися
Вставка
  • Опубліковано 30 вер 2024
  • In this video, we're looking at animation basics in Unity. We'll explore how to set up walk and idle animations, and how to flip our sprite from left to right. This video works as a standalone, but is also the second video in a beginner-friendly series where we create an Action RPG in the style of Zelda: A Link to the Past.
    Next time we'll get started with setting up a tilemap for our player to move around on.
    Planned Release of Video #2: June 5, 2024
    I'm planning to release one video a week until the series is complete. If you'd like to help out a little studio to speed up this process, feel free to give me a Super Thanks, check out my patreon account, like this video, or leave me a comment.
    ASSETS USED
    Assets used in this video are from PixelFrog's "Tiny Swords" asset pack. You can find the asset pack on itch.io :
    pixelfrog-asse...
    🔗PATREON LINK🔗
    With a little support, I can make time to double the release schedule, providing two videos each week. Check out the campaign:
    / nightrunstudio
    🎹 MUSIC 🎹
    Town Music
    Night Run Studio
    from the Willard Soundtrack

КОМЕНТАРІ • 14

  • @kamm3021
    @kamm3021 Місяць тому +1

    This is very helpful
    Thanks for making this series

    • @NightRunStudio
      @NightRunStudio  Місяць тому +1

      You’re welcome! Glad to hear when people find the series helpful!

  • @Mavs_GT
    @Mavs_GT 4 місяці тому +1

    hi thank you i just finished your inventory system, do u know how use the block from inventory and place it on tile? like minecraft but 2d

    • @NightRunStudio
      @NightRunStudio  4 місяці тому

      I'm afraid that's a whole tutorial in itself. I know that Muddy Wolf has a video on Destructible Tiles and another on Spawning Tiles. I haven't tried them myself, but I know people who've found them useful. That might be a good place to start looking.

  • @anoushmistry
    @anoushmistry 4 місяці тому +1

    Yay another video ❤️❤️

  • @anoushmistry
    @anoushmistry 4 місяці тому +1

    I just used the pre made animations given in the asset pack and I am using a blend tree for idle and movement related animations. Is that okay? 🤔

    • @NightRunStudio
      @NightRunStudio  4 місяці тому +1

      That should be just fine. Later, we will add a simple state machine to our code for controlling the player's different states and animations. At that time, you may have to do a little adjusting, but it shouldn't be a big deal.

    • @anoushmistry
      @anoushmistry 4 місяці тому +1

      @@NightRunStudio Thanks a lot

  • @snookems17
    @snookems17 4 місяці тому +1

    Why is your code for the flipping so complicated? I used these lines and it works just fine.
    if(theRB.velocity.x > 0)
    {
    transform.localScale = Vector3.one;
    }
    if (theRB.velocity.x < 0)
    {
    transform.localScale = new Vector3(-1f, 1f, 0);
    }

    • @NightRunStudio
      @NightRunStudio  4 місяці тому +1

      We will build on it later, so having facingDirection stored will come in handy. Also, as movement scripts grow, separating concerns (like Flipping) into their own methods is considered best practice (that way we don't get monster scripts that are hard to read, where Update is packed with stuff).
      The other reason is that Vector3.one only works if people don't touch their scale. If they re-size their scale, Vector3.one suddenly introduces scaling issues.

    • @atilliator
      @atilliator 26 днів тому +1

      @@NightRunStudio spriteRenderer.flipX = true;

    • @NightRunStudio
      @NightRunStudio  26 днів тому

      @atilliator that one is super helpful if all you need is to flip the sprite. But if you are going to add children that also need to flip (like weapons, health bar, etc) rotate works nicely.