Sprint and Stamina Using Components in Unreal 5

Поділитися
Вставка
  • Опубліковано 15 жов 2024

КОМЕНТАРІ • 20

  • @acdev7027
    @acdev7027  7 місяців тому +4

    I double-checked my tutorial project, and it looks like mine was also continuing to sprint. This should fix it:
    27:00 - in Spend Stamina method, instead of if (amount 0). Replace the >= stamina with amount > 0 and it should work. That's what I have in my original notes.

    • @darkwraithcovenantindustries
      @darkwraithcovenantindustries 7 місяців тому

      That fixed it thank you!

    • @javideas
      @javideas 5 місяців тому

      I made the whole system, working perfect. It was a very insightful take on components, thanks, although I am gonna make my own, without timers and other logic, different variables and behaviour (more like rdr2 sprint-stamina based on "press once" each time).
      Something that could be interesting to others is that components work fine in Player Controller, as long you have already a reference for the Character Movement (which I send from my BP_Character to my PlayerController using an Interface). In this way I can switch to different BP_Characters for debugging porpouses using same Player Controller (just adding this "BeginPlay interface sending" in each BP_Char I want to test), which contains all the input related logic, including sprinting and stamina.

  • @Shiny_SSB
    @Shiny_SSB 9 місяців тому +2

    This came out right as I wanted to implement stamina in our game, didn't even know components existed as I'm very new to unreal, thank you so much for the in depth tutorial!

  • @JakubHojsan
    @JakubHojsan 6 місяців тому +1

    After many seemingly good tutorials, this one was best since I was hitting walls in my expansion of my stamina system. Helps to keep it like this.

  • @TheShoden
    @TheShoden 23 дні тому

    Great tutorial, explained well and loved it. Very useful information, thank you!

  • @Ryan-pm3bg
    @Ryan-pm3bg 7 місяців тому

    Wow this video is awesome. Converting from unity to unreal, this helps so much.

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

    I spent a solid twenty minutes trying to figure out where I'd went wrong with the UI percent based fill for the stamina bar, only to realise that I'd set the bar to follow max stamina divided by current stamina, rather than the reverse. What a goofy error lol.
    Great content. It was really easy to follow and helped me set up a stamina usage system, with other system functionalities like you mentioned, in a 2D sprite based game very easily!

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

      glad I could help! I love it when people can take the tutorial and build off of it, that's the goal!

  • @DamienRamirez
    @DamienRamirez 9 місяців тому +1

    This is Genius, I mean it should be common sense, but it never occurred to do something this obvious.... Have to see what else I've been overlooking.

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

    Thats cool. Really nice done and a good explanation.
    I got a question here. How can a prevent my Char to sprint backwards or sideways ?
    Regards

  • @maximschupak
    @maximschupak 5 місяців тому

    Thanks bro

  • @BrettSenneker
    @BrettSenneker 5 місяців тому

    Why put them on separate components if they're so connected?

  • @jjoffgrid3699
    @jjoffgrid3699 8 місяців тому

    So I have a few bugs with this. First bug: The character never stops sprinting. Did debug and the stop sprinting function, after the branch on the triggered output, of the enhanced input IA_Sprint never fires. Also, it continues to spend stamina as long as the key is pressed whether the stamina is empty or not. It isn't until you release the key that it starts filling the stamina and stops printing the string I put after spend stamina in the same line. Second bug: The stamina will drain and spend even when not moving. ( not sure if it is part of the previous problem.) I have tried to put an ismoving check and I cant seem to get it to function correctly as it will either spend it anyway, or take the sprint ability away completely. I have tried many input parameters in the input action for sprint to no avail. I appreciate your video as it was super educational. New to game Dev. Any and all help would be appreciated. Thanks.

    • @LyteRetro
      @LyteRetro 8 місяців тому +1

      Im having the same issue

    • @jjoffgrid3699
      @jjoffgrid3699 8 місяців тому

      @LyteRetro I am working on an actor component blueprint with Stat functions. If you're interested. I can add you to my discord, and we can share notes.

    • @LyteRetro
      @LyteRetro 8 місяців тому +1

      nvm the sprinting did stop its just my walk speed was so fast it looked like i was sprinting

    • @LyteRetro
      @LyteRetro 8 місяців тому +1

      @@jjoffgrid3699 sure

    • @dreamsprayanimation
      @dreamsprayanimation 6 місяців тому

      Every Sprint/Stamina tutorial on youtube suffers from these problems. It's like there is no one that actually knows how to do this correctly. Quite baffling honestly.