Sprinting And Stamina - Unreal Engine 5 Tutorial

Sdílet
Vložit
  • čas přidán 3. 07. 2024
  • Hey guys, in today's video I'm going to be showing you how to create a sprinting (running) system with stamina that drains and refills. The stamina will also be displayed on-screen for the player to see in a progress bar.
    #UE5 #UnrealEngine5 #UE5Tutorial
    ___________________________________________________________________________
    00:00 - Intro
    00:13 - Overview
    01:07 - Sprinting
    05:29 - Stamina
    12:05 - Displaying The Stamina On-Screen
    16:15 - Final Overview
    16:40 - Outro
    ___________________________________________________________________________
    If you enjoy make sure to subscribe: / @mattaspland
    Join My Discord Server: / discord
    Follow Me On Twitter: / matt_aspland
    Follow Me On Instagram: / matt_aspland_
    All My Social Media Links: linktr.ee/MattAspland
    ___________________________________________________________________________
    If you want to support me, there are many different ways of doing so. This is by no means expected or required. It is just a nice support :)
    Patreon: / mattaspland
    PayPal: paypal.me/mattaspland?country...
    Ko-Fi: ko-fi.com/mattaspland
    Thank you :)
    ___________________________________________________________________________
    To access the project files and screenshots from the video, check out my Patreon above!
    My Public Video List: trello.com/b/7vJgXzBm
    Unreal Engine 4 Tutorials Playlist: • Unreal Engine 4 Tutorials
    The Basics Of Nodes Playlist: • The Basics Of Nodes In...
    ___________________________________________________________________________
    ♫Outro Song♫
    ●Kronicle - Chill Noons

Komentáře • 265

  • @stathiszoulakis9599
    @stathiszoulakis9599 Před 8 měsíci +1

    thank you so much , i always watch your video once and copy everything you do to get it working and then i view the video again and i focus to understand what and why you do in the video.started learning unreal engine again , i totaly understand how the stamina works now

  • @AvB.83
    @AvB.83 Před 2 lety +5

    Thank you very much! Before this day I had never added a new movement to UE, a widget, or anything like a stamina system... three hours later, I can walk, jog or sprint, the later draining the stamina at different speeds. Very easy to understand & straight forward.

  • @mrsniffles2528
    @mrsniffles2528 Před 4 měsíci +3

    Perfect guide you are a legend. I followed other guides that were so complex and they didn't even work. Your is simple and perfect

  • @RedCat_Noodle
    @RedCat_Noodle Před 19 dny

    I know this an older video but it still holds up and I could follow it even as a beginner! Thank you so much.

  • @nislaav6712
    @nislaav6712 Před rokem

    All worked perfectly, thanks a ton!

  • @LungaProMecha
    @LungaProMecha Před 26 dny

    This is a great and clear tutorial, really helped clean up my stamina system. Thanks

  • @thegeeeeeeeeee
    @thegeeeeeeeeee Před rokem

    Great tutorial! Works like a charm

  • @cristobalink2413
    @cristobalink2413 Před 10 měsíci

    oh man thank you for this amazing tutorial, really easy to follow and worked at the first try :D

  • @obijohn1
    @obijohn1 Před rokem +1

    thanks so much for your work. As a noob this way of learning is fantastic

  • @DavidGWilliams1981
    @DavidGWilliams1981 Před 2 lety

    Works perfectly, thanks.

  • @identitea_
    @identitea_ Před rokem

    Helped me so much!! Thanks a bunch.

  • @scarpheel
    @scarpheel Před 2 lety

    You are truly my saviour

  • @stoneageprogrammer432
    @stoneageprogrammer432 Před rokem +7

    Hey, I want to say THANK YOU FOR MAKING THIS TUTORIAL! I followed it, I added sprint to my player character in my game, and it works perfectly. You go a little fast in the tutorial, but that's okay, it teaches me to listen. I'm gonna watch a lot more of your tutorials, you are great, and please keep making UE5 tutorials for beginners like me. Thank you again.

  • @GutStabber
    @GutStabber Před 4 měsíci

    Very good video, well done ! nice explanations!

  • @inspiredexpired9137
    @inspiredexpired9137 Před měsícem

    Well that was perfect. Thanks! got a sub!

  • @TwinGeminiStudio
    @TwinGeminiStudio Před 6 měsíci

    Wow. Amazing. Thank you.

  • @Castroo
    @Castroo Před rokem +1

    Thanks bro, I recommend people to make other things by what you learned from this video like making character slow walk by pressing alt and so on, will help in remembering it later.

  • @theetashopunkster338
    @theetashopunkster338 Před rokem

    what an awesome vid, thanks bro!

  • @playbyan1453
    @playbyan1453 Před rokem

    Good tutorial, also beginner friendly too

  • @offirbaruch7895
    @offirbaruch7895 Před rokem +23

    Matt. Excellent guide.
    Just one remark.
    I would really recommend you to use Event dispatchers in the drain/regen events instead of binding functions in the widget. Dispatchers event will only call upon change of stamina and will not perform the check every frame like your guide mentioned.

    • @xssplater1
      @xssplater1 Před rokem +1

      Thank you!👍

    • @FarmerJoe-fs4nv
      @FarmerJoe-fs4nv Před měsícem

      Hey bro, may I ask how this can be done and what this improves upon? (Performance, Accuracy, Etc.)

  • @samuraiyt4453
    @samuraiyt4453 Před 2 lety

    Perfect for my game!

  • @phantomslayer9714
    @phantomslayer9714 Před 2 lety +1

    Hi, thanks for your videos , I started learning unreal yesterday. So far all your content helped me so much in learning . Thank you so much ! Keep up the great content . An idea for something new 😅. Maybe make a video showing how to make stamina decrease when swing a weapon

  • @thelostangel45
    @thelostangel45 Před 6 měsíci

    Well, thats two for the night, thanks again!

  • @kresus10
    @kresus10 Před 8 měsíci

    Amazing.

  • @Lendu_
    @Lendu_ Před 5 měsíci +2

    for those who have the bug of the regen and drain at the same time, change the trigerred to started in the input action

    • @luisnache9688
      @luisnache9688 Před 5 měsíci

      Hey man, sorry to bother you, but, i did the dash movement and i don't know how to connect it with the stamina, could you help me out please?

    • @Lendu_
      @Lendu_ Před 5 měsíci +1

      @@luisnache9688 you have to create a function referenced by the sprint input action that make the reference of a custom event

    • @luisnache9688
      @luisnache9688 Před 5 měsíci

      @@Lendu_ this is so complicate, i don't wanna bother anyone, but how do i do that?, i sorry!, it's my second day on this and most videos aren't focused on this type of answers

    • @Lendu_
      @Lendu_ Před 5 měsíci

      @@luisnache9688 i don't know what is so complicate for you

  • @Mohamed88Hassan
    @Mohamed88Hassan Před 4 měsíci

    I really love ur videos u r amazing keep going body , ty 😇

  • @DarkPlayerBr
    @DarkPlayerBr Před 4 měsíci

    great tutorial 🕶

  • @Skyrim973
    @Skyrim973 Před měsícem

    Very nice. You can set W key in inputs, for run, The player does not need to press any button, just stop for a while to rest.. And it will stop run and star walking at the end. You could multiply your stamina by 10 by eating food or sleeping, for a certain time..

  • @devformation
    @devformation Před 2 lety

    Thanks alot!

  • @sonofzues8414
    @sonofzues8414 Před rokem

    Thank you very much

  • @MCgrant360
    @MCgrant360 Před 10 měsíci +1

    I have been suck on this for a long time, Due to an "infinite" loop. When i found this video, i was excited to find out what i was doing wrong. Thanks for another great tutorial, Matt!

    • @KTW_Monterrattian
      @KTW_Monterrattian Před 9 měsíci

      How did you fix your infinite loop error

    • @KTW_Monterrattian
      @KTW_Monterrattian Před 9 měsíci

      Cause I’m having a similar issue

    • @MCgrant360
      @MCgrant360 Před 9 měsíci

      It was back when I was trying to figure it out my self. I don't know why the code on the video should cause an error. Maybe check over your code once more.

    • @cosmicgub1014
      @cosmicgub1014 Před 3 měsíci

      ​@@KTW_Monterrattian in character blueprint delete the "STAMINA REGEN" node and keep it only in stop sprinting function

  • @brunovelez4329
    @brunovelez4329 Před rokem

    Great!!

  • @Medricito
    @Medricito Před 2 lety +1

    Hi! This Was A Amazing Tutorial, I Wanted To Implement One More Function With The Stamina Bar, When The Character Stop Sprinting, I Want It To Wait For A Few Seconds Before Starting To Fill The Stamina Bar Again, Thank You So Much!

    • @bl1zz4rd.
      @bl1zz4rd. Před rokem

      can you add a delay before the command?

    • @coincape433
      @coincape433 Před rokem +2

      on stop sprinting just do a custom event instead of regen I it called regen delay then put the delay part and then the regen part.

    • @SpasticLlama
      @SpasticLlama Před rokem

      @@coincape433 I know this is months old but I didn't see anyone give you a response to this and I wanted to say thank you because this was driving me crazy

  • @agus11125
    @agus11125 Před rokem

    good video, I used float values for the stamina properties

  • @lossapote
    @lossapote Před 2 lety +1

    I love your videos. I wish if you can do a tutorial of lock-on to an enemy

  • @raccoon_05
    @raccoon_05 Před rokem +1

    Great tutorial. Got a nice stamina system in my game thanks to you!

  • @o0jager0o81
    @o0jager0o81 Před rokem

    thanks so much

  • @ickebong5890
    @ickebong5890 Před rokem +41

    to get rid of the losing stamina while pressing shift and not moving do this
    Where you set inputAction Sprint Pressed/released create (get velocity) then connect it to a !== and connect that to a branch (b + left click). Delete the connection between Pressed and start sprinting and instead connect it to the branch you just created. Connect the true value of the branch to the start sprinting, now its fixed :D

    • @brady9621
      @brady9621 Před rokem +1

      Still didnt work

    • @spyn5574
      @spyn5574 Před rokem +1

      its working but when i stop pressing the button to move forward its continues to take energy away from me...

    • @vasi3005
      @vasi3005 Před rokem +1

      @@spyn5574 Just connect the "Released" to another Stop Sprinting node. It wont fix everything but that is something that solves a lot :)

    • @MidnightTheFolf
      @MidnightTheFolf Před rokem +1

      This helped me a lot, but I had another problem after, while holding forward and sprint, then letting go of forward, your stamina would still decrease. An easy fix is to connect all the nodes attached to the Branch to the Drain Stamina custom event, and connect True from the Branch to the Set Stamina.
      (EDIT. I also put the nodes on the Event Tick, with an == Vector and connected True to the Regen Stamina. Also you can call Stop Sprinting after you call Regen Stamina, make a Branch and check for if move input is ignored with "Is Move Input Ignored", then copy Stop Sprinting and Regen Stamina to the end and connect True. This fixed the problem where if you hold forward and sprint, then let go of forward to come to a stop and hold it again, I'd still be at sprint speed, but no stamina would be used.)

    • @bsg8761
      @bsg8761 Před rokem

      Sorry I'm late.
      If you guys want it the way I did where press+no movement =shows no draining bar. Holding shift+no movement =showing bar then + movement= adding drain, and moving+holding shift=show bar and drain.
      Do exactly as this comment says.
      On pressed set the display widget first - connect it to this branch created like above first. On fail run the sprint code.
      On true run a short delay even default, then connect the delay to the start of the branch.

  • @user-kv6sg3gq2d
    @user-kv6sg3gq2d Před měsícem

    nice

  • @tehf00n
    @tehf00n Před 2 lety

    Strange but you keep doing tutorials on things I've just done. :D

  • @HaydenHancock0
    @HaydenHancock0 Před 9 měsíci +6

    Great tutorial! There are a couple of issues that I found.
    - Stamina will decrease if you press the sprint key (even if not moving)
    - When tapping the sprint key, the stamina progress bar doesn't get to 100

    • @sycho_zer0edits451
      @sycho_zer0edits451 Před 5 měsíci

      how to fix it?

    • @GangsterFrankensteinComputer
      @GangsterFrankensteinComputer Před 3 měsíci

      @@sycho_zer0edits451 add a branch before draining stamina to detect velocity on x and y axis.

    • @larsbrockob
      @larsbrockob Před 2 měsíci

      @@sycho_zer0edits451 Add a branch right after your Drain Stamina Custom Event in the Player Character. To set the condition get ´Get Velocity´ (Target is ´self´) Out of the ´Get Velocity´ return value get a "Vector Lenght". Then Out of the Vector Lenght Return Value get a ´Greater´Operator and set the second value to ´0´. That creates a Boolean Condition (Red Output) that must be connected to the Branch Condition you created in Step 01 of my description. Connect the ´True´ of that branch to your existing code (Must be the Execution Path of Set Stamina, i think.). No go to the end of your Drain Stamina Code and Copy the Delay and the Drain Stamina Call that you´ve placed after the "Is Sprinting=true" Branch. Paste this to the beginning of the code and connect it to the False Output of your "GetVelocity-VectorLenght-Greater´0´ Branch that you´ve created in Step 01.
      Out of that Drain Stamina get another branch (I call it "Branch X" here for an easier understanding).
      Now Copy and paste the Get Velocity&Vector Length you just created and add a "Less" Operator to the Return Value of Vecor Lenght. Set the Second Value to 0.1. Drag out of the Boolean Condition (Red Dot) and connect it to the Condition of "Branch X".
      That will Gain your Stamina, even if you still press the Sprint Button after you stopped moving in Sprint.
      I hope it´s easy to understand?!?! Otherwise feel free to ask.

    • @thehobbist5544
      @thehobbist5544 Před 2 měsíci

      Did you ever find a fix?

    • @GangsterFrankensteinComputer
      @GangsterFrankensteinComputer Před 2 měsíci

      I'm pretty certain I replied with a fix. Definitely replied as I got a notification, no clue why my comment was deleted.
      Anyway, you can fix the stamina drain while not moving, by adding a True/False for player velocity in order to perform the Sprint.

  • @JustMe1272
    @JustMe1272 Před 8 měsíci

    one note: By writing the code and just run the game to check if it really works but visible to the viewer. There should be checks.
    Otherwise great tutorial thanks!

  • @ErodonTV
    @ErodonTV Před rokem

    Great video thanks!! Is there a way to just increase speed by increments on button press or do we need Cpp for that ?

  • @hoomankollol6379
    @hoomankollol6379 Před 2 lety

    👌👌👌👌

  • @MrTreeGuy
    @MrTreeGuy Před 2 lety +18

    Hey matt! I was wondering if you could make a tutorial on how to save variables such as booleans intergers etc. even when u quit the game those variables are still saved. Thanks for reading!

  • @wesss9353
    @wesss9353 Před 2 lety +5

    sound effect for when sprinting? foot and breathing
    How about a level up system like fallout when you can increase the amount of stamina after a character upgrade.
    General character upgrade tutorial will be great

    • @Urzart
      @Urzart Před rokem +4

      Idk if you still need the breathing, but here it goes:
      In the drain stamina -> connect the stop sprinting function to -> "Spawn sound at location" node -> connect location to -> "GetActorLocation" node.
      That's for a heavy breathing after running

    • @wesss9353
      @wesss9353 Před rokem

      @@Urzart thank you for the assistance

  • @toufu_studio
    @toufu_studio Před rokem

    Thanks for the great tutorial!
    May I use the content presented in your tutorial in my game?

  • @Venomulta
    @Venomulta Před rokem +2

    Hey Matt could you tell me how can I make delay for one second to regen stamina ?

  • @paraboy5629
    @paraboy5629 Před 2 lety

    👍👍❤️❤️

  • @Venomulta
    @Venomulta Před rokem +1

    Matt I really appricate your effort of making those tutorials you are one of a kind.
    do you have petreon or anything so we can support you for the good work ?
    again Thanks a lot !!

    • @MattAspland
      @MattAspland  Před rokem +1

      Thanks for your support mate, super happy I could help! :)
      I do indeed have a Patreon yes, thanks again!
      www.patreon.com/MattAspland

  • @d5k4capy62
    @d5k4capy62 Před rokem

    ty

  • @flowercrowned3550
    @flowercrowned3550 Před 5 měsíci +1

    I had the same issue that a lot of others had with the stamina depleting even when you stopped sprinting and I found the issue (at least mine). I went into the "Stop Sprinting" function and unchecked the "Is Sprinting?" checkbox, because if the character is NOT sprinting, we should regenerate the stamina.
    At 3:55 he unticks the box. I completely missed that as I was following along lol

    • @hunterjenkins576
      @hunterjenkins576 Před 16 dny +1

      holy shit you are right lol I did all the things everyone else did in the other comments but you should be at the top this is the solution to the problem we're all facing, thank you man

  • @KaiJohnson-zf7ci
    @KaiJohnson-zf7ci Před 10 měsíci +1

    matt for some reason I cant get event begin play, there is already one of them, could I have some tips?

  • @crazypopcorn7801
    @crazypopcorn7801 Před rokem +2

    it's working but even if my character is standind still, if I hold left shift the stamina starts consuming, can someone tell me how to fix it?

  • @vum3819
    @vum3819 Před 2 lety +1

    Hi Matt! Can you make a crouching tutorial for Unreal Engine 5. Thanks you.

  • @TheRealLM_FN
    @TheRealLM_FN Před rokem +1

    my project seems to priorize the default speed. When the defaut is 300, the walking in 300 and the run is 600, its locked up to 300 in both walking and sprinting. It glitch and seems like the player is locked in a grid snapp

  • @svallone7725
    @svallone7725 Před rokem

    How would you make main character limp from damage, attack or from falling? any tutorials or help with it???
    & luv your tutorials man… thank you so much… 👨‍💻🌎

  • @astralstormgamestudios1259
    @astralstormgamestudios1259 Před 6 měsíci

    What's the reason for making functions when you could make it right in the event graph? Is functions a cleaner and more reliable way?

  • @KylezUwU
    @KylezUwU Před rokem

    Anyway to have it so you cant sprint until the stamina is fully regen?
    Also when standing I still use stamina. Comments on this cant seem ro resolve the issue.

  • @LaceUpBrah
    @LaceUpBrah Před 9 měsíci

    Something is really strange, I've literally double checked and everything works as intended in game but the stamina widget doesn't change at all like it would be empty at all times even though it isn't.

  • @user-oe6go2nz4f
    @user-oe6go2nz4f Před rokem

    hello I want to ask if my character was stop and Iwas press the shift at the same time but I dont want to minus my stamina how should I do

  • @Rapid412
    @Rapid412 Před rokem

    Hey, so have been trying to add a Event begin Play to my BP but it wont let me, please help

  • @elious611
    @elious611 Před 10 měsíci

    When i create an event begin play, only the one create will stay stopping me from moving, is there a way to fix this?

  • @WM_Plays
    @WM_Plays Před rokem

    can you make it so when you jump you drain stamina? Also great tutorial!

  • @mthangtrng8056
    @mthangtrng8056 Před 8 měsíci

    how can I create another beginplay event?

  • @prishongamer300
    @prishongamer300 Před 10 měsíci

    How are you get event beiginingplay

  • @gustavbechmann8952
    @gustavbechmann8952 Před 8 měsíci

    How would you create a delay after you stop sprinting, before you regen stamina?

  • @ApocalypsFroid
    @ApocalypsFroid Před rokem

    hello sr. can you make experience bar to get when kill monster ?

  • @32bitbailey
    @32bitbailey Před 2 lety

    hey! quick question do you think there is a way to implement this into a boost system for a racing game? thanks again :D

  • @tigertazdaisyban
    @tigertazdaisyban Před rokem

    how would you make this a power up?

  • @JerrysCousinn
    @JerrysCousinn Před 2 měsíci

    My only issue I am having is when my character dies and respawns the stamina bar does not fill back up when I posses a new BP_Thirdperson. The function works perfect, it just doesnt show that the bar is filled back up after death and respawn

  • @duckyducktape4205
    @duckyducktape4205 Před 6 měsíci

    help at 14:00 „get stam“ doesnt show up

  • @oliverbrown9634
    @oliverbrown9634 Před rokem +1

    at 2:11, for some reason, rather than having when key pressed and when key released i have unnamed and axis value, which is a float output. how do I fix this?

    • @TheRealLM_FN
      @TheRealLM_FN Před rokem +1

      the input you created is an axis input, should be an action input

  • @devastaterboy8227
    @devastaterboy8227 Před 5 měsíci

    I have a problem my stamina bar is not decreasing when I release l shift

  • @tianzlatev3119
    @tianzlatev3119 Před rokem +1

    how to make jumping take stamina?

  • @ghosteso6797
    @ghosteso6797 Před rokem

    I’ve followed this through twice and I’m unsure what’s going wrong. Instead of regen stamina at event begin play, my project is regenining stamina when I press the keybind I set up to sprint?? Can anyone help!?

  • @agentshadow6618
    @agentshadow6618 Před 7 měsíci

    I have issue please anyone help, how can i make chracter run when he is holding shift

  • @deanthedev
    @deanthedev Před 4 měsíci

    Great tutorial. But if I stay still and hold shift stamina goes down.

  • @leosky789
    @leosky789 Před rokem

    I'm stopping but my stamina run away from me. I wondered why. Because I recheck everything. What's the problem here?

  • @UltraMonS12
    @UltraMonS12 Před rokem

    How Can I make this work In Multiplayer

  • @xxspecterxx
    @xxspecterxx Před 8 dny

    I can’t figure to change the drain speed, I also drain stamina when not moving

  • @charzardking9419
    @charzardking9419 Před měsícem

    how come mine does not drain the stamina like at all and why does it also not stop sprinting when I don't hit sprint it walks when I don't hit but when I do once the character is running for the rest of the code

  • @ayaanhaque6340
    @ayaanhaque6340 Před 2 lety

    Hi Matt. Could you make a tutorial on a sinking ship? Like a cannonball/bullet puts a hole in it and causes water to flood in. Because the default UE5 water isn't completely physicalized, You could spawn in a Niagra Fluid at the impact point and cause it to flood the ship, maybe setting a specific weight in the process that could sink the boat.

  • @Tastyham99
    @Tastyham99 Před 4 měsíci

    This wasn't really working for me properly, not sure if I did it wrong or not. Kept adding stamina once it got to zero even if I was still running.
    But for anyone having issues I just put an IsSprinting check in the Event Tick, that way stamina is constantly being checked.

  • @NOTxINewGenIx
    @NOTxINewGenIx Před 8 měsíci +1

    Ok I've been stuck on this video for two days and I can't place the stamina on screen

  • @yberkiwi7347
    @yberkiwi7347 Před rokem +25

    there''s one issue, u drain stamina when u press shift, even if u're not moving

    • @ajfraser224
      @ajfraser224 Před rokem +5

      I guess there is probably some kind of IF statement you could use for this, like disable left shift if the character is not moving

    • @chikinfinguh
      @chikinfinguh Před rokem +2

      make your axis mappings for forward/backward/left/right into a 2d vector length and check if it is == to 0 and then that should connect to a branch which will check if the player is moving or not

    • @dark11demon11
      @dark11demon11 Před rokem

      @@chikinfinguh in this case you won't generate stamina when you just walk...

    • @chikinfinguh
      @chikinfinguh Před rokem

      @@dark11demon11 generating stamina and draining stamina should be different functions. so they won't effect each other

    • @dark11demon11
      @dark11demon11 Před rokem

      @@chikinfinguh wait I just woke up and wrote something that not what I meant. So disregard first message. the two functions are supposed to be symmetrical. I'll experiment in code. I remember Either you not gaining stamina while shift, or you won't be able to run again still holding shift and press W. But I need to get to code to see where I left last night

  • @SleepyNubis
    @SleepyNubis Před 2 lety +1

    For some reason my stamina bar always shows up black never blue

  • @johnmiller4998
    @johnmiller4998 Před rokem +2

    hey guys so if you get an error about not having bp third person inherit player controlller heres the fix
    The warning message is because you are trying to cast a PlayerController into a Character (never gonna happen)… But, the solution is very simple! Just replace the “Get Player Controller” node with a “Get Player Pawn” node. Hope this helps!

  • @Sause760
    @Sause760 Před rokem

    Been leanring UE5 for about a week now. When I start to play , I begin to sprint but when I release left shift the character doesn't stop sprinting. The stamina doeant deleat smoothely . When you start to spring it take a few seconds and the stamina bar goes to about 20 percent full . Never all the way down. Then it never regenerates. I have watched this video many many times and tried some tweaks but nothing seems to work . Any suggestions would be greatly appreciated!
    Update . I was able to get most everything working . However I am having trouble with the stamina bar not depleting fast enough while sprinting. It also regenerates way to fast . Thank you .

    • @notion8329
      @notion8329 Před rokem +1

      You can make your stamina drain faster by decreasing the delay time or changing how much gets depleted. Same goes for regenerating the stamina.. Keep in mind if you change the delay time don't also change the add/subtracting stamina value.. Because then you will end up in the same predicament
      Delay time => Higher the value the slower it regenerates or depletes.. Lower the value the faster it regenerates or depletes.

  • @BUN-D
    @BUN-D Před rokem

    my fps game didn't show the satina bar can someone help me pls ?

  • @luxon1232
    @luxon1232 Před rokem

    in the widget, I can't move my progress bar and I can't make it bigger, can someone help me? (I don't speak English)

  • @punkx4044
    @punkx4044 Před 9 měsíci

    very greate tutorial!! but can you help me with another problem which is related to speed? I'm trying to create a character movement like in the game Super Mario Bros. Mario starts walking at low speed and gradually accelerates (without pressing additional buttons). In Unreal Engine, the player uses the same movement speed (starts walking at the same speed, continues walking at the same speed and stops instantly) Thank you!

  • @spiderraptor95
    @spiderraptor95 Před 10 měsíci

    Great Tutorial! I was able to use this perfectly on a UE4 project I've been working on. Although in my project, I have a main menu. And I noticed that the stamina bar appears on my Main Menu. Do you know how I would be able to remove the Stamina widget from the menu so it only shows in my actual game level?

    • @patrickclausen6922
      @patrickclausen6922 Před 9 měsíci

      Either make the main menu a seperate level or hide the widget. That would be my guess

  • @pettybeats2731
    @pettybeats2731 Před 2 lety

    Would you be able to help me find a tutorial for my 3D game where I want there to be 3 lives and once they are all used up it goes to a game over screen? ( I already have it so that once my character dies the level respawns but there is no system in place for him to run out of lives)

    • @tehf00n
      @tehf00n Před 2 lety +1

      You simply use the respawn example on the Unreal documentation and when you fire the OnDestroyed event, check if you have lives left, subtract one from your lives. If it hits 0, goto your game over widget.

  • @simondelguste
    @simondelguste Před rokem +1

    Hello ! Great video, as always ! I was just wondering : is there a simple way to make the stamina bar showing only when we press the sprint button ? Thank you so much for your answer !

    • @magegames6202
      @magegames6202 Před 10 měsíci +1

      make a widget for just the stamina bar on the on pressed for sprint create that widget add to viewport on the released event add a remove from parent node and plug in the blue line from the created widget then when you run it appears and when you stop it vanishes you can add a delay before the remove widget so players can see it start regening before vanishing

    • @simondelguste
      @simondelguste Před 10 měsíci +1

      @@magegames6202 Thank you so much for this tip ! Will try it asap !! 🙏🙏🙏

    • @magegames6202
      @magegames6202 Před 10 měsíci +1

      If you get confused let me know and I'll post a video showing you how I did mine I have it working how you're talking about doing it

  • @sycho_zer0edits451
    @sycho_zer0edits451 Před 5 měsíci

    i did it but it still regens when i sprint.

  • @sk.mahdeemahbubsamy2857

    Can you please make a tutorial.on how to make a hacking mini-game in unreal engine like the bypass mini-game in Mass Effect?

  • @name_isme3245
    @name_isme3245 Před 4 měsíci

    hey, i want to make it so if you press shift before moving it still sprints. i tried making it so that when you press wasd it checks if your prssing sprint then calling start sprint on true, but that only worked when pressing 2 movment keys. any help apreciated. Edit: i also on start sprint it will check your velocity to determin if you sould sprint.

    • @weebdesu1224
      @weebdesu1224 Před 3 měsíci

      Unreal has built in function names Is Moving on Ground that returns a bool if the player is walking or driving on the ground. You can use that to determine to sprint or not.
      Edit : Thats not working, dunno why. But you could get velocity of character movement component and take its vector length then check if its bigger than 0. If it is that means the character is moving.

  • @xHideousFoxx
    @xHideousFoxx Před 11 měsíci

    I made my sprinting system a little bit differently. but the issue I have with mine is that the sprint is a togglable action. however, even if the player is not moving (no matter what I seem to change) the player's stamina is still consumed as if the player is actively sprinting. I used the built in is moving function but it doesn't seem to do anything... : /

    • @svenv32
      @svenv32 Před 10 měsíci +1

      I checked the velocity if it is above 0 or not

  • @Axel0689
    @Axel0689 Před 7 měsíci

    Can this mechanics be linked to other actions, such as rolling or other? That is, as I perform rolling, I consume stamina. And when I get to a specific percentage, I cannot perform rolling.

    • @painpega
      @painpega Před 6 měsíci +2

      I managed to do it for jumping, so I imagine you can do it with rolling too. I used the default jump and literally just copy pasted the drain stamina section and connected it to the blue Jump box next to the EIA. Make sure to delete the Stop Sprinting box connected to the true section of the first branch. Then you can change the value in the Subtract node to make jumping take as much stamina as you want
      I imagine you would do the same thing with any other mechanic as it's really just a keyboard input with that functionality added to the end of it