UE4 Tutorial - Creating a Stamina System

Поділитися
Вставка
  • Опубліковано 6 жов 2024
  • Join the Discord: / discord
    Follow us on X/Twitter: / auroragameworks
    Like us on Facebook: / auroragameworks
    Aurora Gameworks is an indie game studio run by Andrew Welsh. I use Unreal Engine to create fun, high-quality games. Follow me on other platforms for more updates.
    SYSTEM SPECS:
    CPU: i5-8600k
    GPU: GTX 1050 Ti
    RAM: 16GB DDR4 2666Mhz
    Storage: 4TB HDD
    Based in New Zealand
    #ue4tutorial #unrealengine #ue4
  • Ігри

КОМЕНТАРІ • 57

  • @fl260
    @fl260 4 роки тому +15

    Just a tiny bug I ran into: If, while moving forward, you press Shift and let go fast enough, the stamina bar will deplete to the end before refueling (if you hit Shift again, it stops there and reverses).
    My solution: You have your "Remove Stamina" event, then your "is NOT falling" check; right after that I added another check: Is input key down? (pulled from Get Player Controller), from there, if the output is True, we can continue decrementing stamina, and if the output is False, obviously we do nothing.
    Tested through and that's the only bug I could find!

    • @fl260
      @fl260 4 роки тому +4

      @Simon Chung No worries! Check out the bug fixes videos I made about the system! A necessity!
      1 - ua-cam.com/video/vG81uKw1zYA/v-deo.html
      2 - ua-cam.com/video/HDHu2JofcuA/v-deo.html

  • @BeamFreqGames
    @BeamFreqGames 2 роки тому

    Thank you. I needed the logic so that when the Player is not moving they can press the Sprint key all day long and nothing happens. Just great how you figured that out.

  • @therealrjbenson
    @therealrjbenson 4 роки тому +3

    these tutorials are awesome!! thanks!!

  • @fl260
    @fl260 4 роки тому +1

    Just bought your game in support dear sir! Will play it when I have a few minutes and leave a review for ya! The least I can do to show my appreciation for your tutorials!

    • @AuroraGameworks
      @AuroraGameworks  4 роки тому

      Thank you so much! I really appreciate it

    • @fl260
      @fl260 4 роки тому +1

      @@AuroraGameworks Hey man, I hope you don't mind if I posted a little video (well, two videos in fact) on my channel addressing the tiny bugs in your stamina system? I tried giving you credit cause it's a great system and if you want to upload yourself a video addressing these bugs (maybe with different solutions) I will gladly delete them. But in the meantime, they're there to help people and nothing else!

  • @andrewowens452
    @andrewowens452 3 роки тому +2

    This is by far one of the most complex and advanced stamina systems I've seen so far. This is an amazing tutorial, thank you for your work! Do you think it would be possible to add a little person icon beside the stamina bar that changes based on your movement status? For example, if you were running, the icon would be running, and if you were crouched or swimming, the icon would be crouched or swimming. Thanks!

  • @willienwen8435
    @willienwen8435 2 роки тому

    Great tutorials !!

  • @Yazoon_S
    @Yazoon_S 4 роки тому +1

    cool, looking forward to see more amazing new tutorials :D

  • @fernandodasilva-producoesa1023
    @fernandodasilva-producoesa1023 3 роки тому

    Thank you for this, i had to use this for a college work and the only thing that didn't worked well was the stamina bar

    • @AuroraGameworks
      @AuroraGameworks  3 роки тому

      You're welcome! Admittedly there's a few things not exactly right in this tutorial, but I'm glad for the most part it's been helpful

  • @pandknz
    @pandknz 4 роки тому

    Really good system, I'm glad I came across this, nice work!

  • @callofdutyhighlights6709
    @callofdutyhighlights6709 4 роки тому

    Fantastic tutorial, Thank you

  • @Mon_Duerte
    @Mon_Duerte 3 роки тому +1

    First of all: great video !, how could you add a small delay before starting to replenish the stamina ?

  • @tacticcoconut
    @tacticcoconut 5 років тому +2

    Great Tutorials Man!!
    These tutorials really help me out in my game. I just have run into a problem where when I am in midair and press sprint, I am no longer able to space in the game anymore, Could you please give me fix for this?
    EDIT: The problem is that if I press shift while jumping I can't run anymore, sorry for the late edit of my mistake

    • @AuroraGameworks
      @AuroraGameworks  5 років тому +1

      Good spot! Thank you for sharing the issue with me. Create a branch node at the "Jumped Pressed" Input, and connect the "Jumping?" boolean variable to it with a "not" node. This way, we will only jump if we aren't already jumping, and if we're in midair, it won't try to execute the jump code again. Hopefully this should solve the bug. If not, I'll further into it!

    • @akashP998
      @akashP998 4 роки тому

      @@AuroraGameworks Didn't worked :[ help please?

    • @Stormmew1
      @Stormmew1 4 роки тому

      @@AuroraGameworks Hi there ​
      So this happend to me when I followed your tutorial:
      A) I can`t run sideways, it does not even let me start draining or get up to speed.
      B)When I am standing still it keeps draining my stamina bar.
      Do you have the time to help me out?

    • @AuroraGameworks
      @AuroraGameworks  4 роки тому

      For question A: The sprinting in this tutorial has been set up with controls following a traditional first/third person shooter game setup, the kind of controls where they only let you sprint with forwards movements, since it's not the most realistic thing for most games to allow you to go full sprint speed while side strafing or going backwards.
      Question B: There's a comment I left a heart on here in the comments section of this video, from a person called Expod. They've been very kind and created a couple of videos going over some bug fixes. Check out those 2 linked videos he has in his comment/comment replies

    • @Stormmew1
      @Stormmew1 4 роки тому

      @@AuroraGameworks Hey, Thanks for the great tutorial.
      I got it to work and I also got it to replicate over the network.
      Thanks a bunch

  • @SsuperVillainN
    @SsuperVillainN 4 роки тому

    this was great thanks

    • @AuroraGameworks
      @AuroraGameworks  4 роки тому

      glad to be of help

    • @SsuperVillainN
      @SsuperVillainN 4 роки тому

      @@AuroraGameworks I spotted a glitch if you try to jump while crouched it will continuously deplete the stamina bar even if released. Any idea how to fix? thanks.

  • @Northgames59
    @Northgames59 4 роки тому +1

    Your tutorial is awesome man ! Thank so much but i have a problem, when i jump with the shift key to sprint, the stamina stop draining and when i touched the ground and sprint again, the stamina will drain again ?

  • @narrgamedesigner2747
    @narrgamedesigner2747 2 роки тому

    I don't see anyone else talking about this but my stamina is not going up and only depletes on every button pressed instead of just holding the button down.

  • @3DAntonio47
    @3DAntonio47 3 роки тому

    Hey, this is cool but how can we only show the stamina bar when you're running or when its recharging, and if its in neither of these states, it fades from the screen? Cool tutorial!

    • @AuroraGameworks
      @AuroraGameworks  3 роки тому

      You can grab the current stamina value, check if it's equal or above (=>). If true, then you can run the logic that would hide the stamina bar.

  • @vukmilosevic3810
    @vukmilosevic3810 3 роки тому

    thank's a looot

  • @chaz813
    @chaz813 2 роки тому

    Great video, I’m trying to apply this to my current project which has jumping, rolling and sword attacking also draining stamina everytime they are performed, but without sprinting it won’t gain stamina back. I’ve tried replicating what’s there under my jumps and rolling but I’m not having much luck. Any suggestions?

  • @daddelbuddiesinkorperated1035
    @daddelbuddiesinkorperated1035 3 роки тому

    Ok my Problem now is that i have a simple Crouch Code but when i am crouching and pressing shift my stamina drains.

  • @DKJens44
    @DKJens44 4 роки тому

    I set everything up the same way, but my character doesn't want to sprint when I press Shift. Shift is set for Sprint in the project settings. It had worked briefly, but not again.

    • @AuroraGameworks
      @AuroraGameworks  4 роки тому

      There's a comment I left a heart on here in the comments section of this video, from a person called Expod. They've been very kind and created a couple of videos going over some bug fixes. Check out those 2 linked videos he has in his comment/comment replies

  • @oliverhayes7220
    @oliverhayes7220 2 роки тому

    I feel like it should be a simple fix, but please does anybody know how to fit in a check so that when I am not moving it will regenerate stamina.
    The issue is if I sprint forwards, but then stop, if I keep holding the sprint key down my stamina will drain even though I am not moving anymore. Thanks to anyone that can help!

  • @chrisvasiakos7623
    @chrisvasiakos7623 2 роки тому

    Hey i have a question everything is working numbers top left but my stamina widget is not depleting its not moving how do i fix this? Thank u

  • @Jitto
    @Jitto 4 роки тому

    Thank you for the video! I have a question, i want to make dashing also decrease stamina which already works but how can i make it automatically increase stamina without sprinting?

  • @AlexTheRealG
    @AlexTheRealG 3 роки тому

    It says infinite loop, how do i fix it

  • @denniz8423
    @denniz8423 4 роки тому

    Hi awesome tutorial man !! I was wondering about one thing, after you spring and hold Shift its still draining stamina, do you know how to fix it ? :)

    • @AuroraGameworks
      @AuroraGameworks  4 роки тому +2

      There's a comment I left a heart on here in the comments section of this video, from a person called Expod. They've been very kind and created a couple of videos going over some bug fixes. Check out those 2 linked videos he has in his comment/comment replies

    • @denniz8423
      @denniz8423 4 роки тому

      ​@@AuroraGameworks Thanks dude I appreciate it

  • @SammyBejarano
    @SammyBejarano 4 роки тому

    21:28
    Hello I know this video is some old, hopefully I can get a response back; at this time when I add event begin play, it pulls me to the top "If HMD and Motion Controllers are enabled," group and highlights that.. :/
    My project file is using the first person blueprint, if someone might know how to fix it :(

  • @arkmoni8983
    @arkmoni8983 3 роки тому

    If I dont want , in the left corner floating blue numbers? Can you tell the fix? :)

    • @arkmoni8983
      @arkmoni8983 3 роки тому

      Just untick print string / print to screen and print to log, lol

  • @niekvandenberg1012
    @niekvandenberg1012 4 роки тому

    Is there a way that i can add a delay when the stamina is empty so that it wont add stamina directly

    • @AuroraGameworks
      @AuroraGameworks  4 роки тому

      Just before the Set Timer By Event that's connected to Add Stamina, you could try adding a delay node in there

  • @grimdiablo119
    @grimdiablo119 4 роки тому

    Hey man, just needed some help, I ran into some problems with this, the stamina bar continues to deplete even after I let go of Shift and my character is not running, it doesn't regenerate the stamina either and if I try to press shift and sprint after doing a jump, the stamina bar does not deplete. Help is appreciated, Pls Do reply.

    • @fl260
      @fl260 4 роки тому

      Did you solve the problem? If not I got the solution for you, as I had the same issue.

    • @grimdiablo119
      @grimdiablo119 4 роки тому

      @@fl260 no, i wasn't able to come up with a solution sadly, so yes help is appreciated :D

    • @fl260
      @fl260 4 роки тому +1

      @@grimdiablo119 Alright, there was two more bugs I needed to fix before replying to you. But since it's quite complicated and it would take forever to explain in a comment box, or plain too long to me to take as many screenshots, you're going to have to get past my strong french accent since I'll make a video for you (and possibly others who might need help fixing it). Shouldn't take too long!

    • @fl260
      @fl260 4 роки тому

      @@grimdiablo119 ua-cam.com/video/_MtA_UCdTdI/v-deo.html (still uploading, sorry if fucking long!!!)

    • @grimdiablo119
      @grimdiablo119 4 роки тому

      @@fl260 appreciate it m8 :D

  • @tzilva3791
    @tzilva3791 4 роки тому

    My progress bar is not going down when I start the game, what can I do?

  • @jediskywalker8670
    @jediskywalker8670 2 роки тому

    Horrifiying code organization