How To Make A Stamina System | Unreal Engine 5 Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right so this time we're going to make a stamina system that fills back up when you're not using it let's get started start by opening your character blueprint we're going to make three new variables the first one is going to be stamina second one is going to be Max stamina and the third one is going to be is sprinting and the first two are going to be floats and set the values to one now I'm going to get left shift and then a branch trigger is sprinting plug that in get another Branch plug it into the false get stamina greater than leave that as zero now we're going to get set is sprinting to true and get your character movement I'm going to set max walk speed foreign and go minus add a value here I'm going to do 0.05 and then clamp it and add Max stamina for the max and now we're going to set stamina plug that in all right now we're going to make a custom event it's going to be to update the stamina make a new event dispatcher for on stamina used call that plug that in and that's good there now we're going to get that event and plug it in up here okay delay and do 0.5 then we're going to get a branch for is sprinting and then we're going to grab the true and plug it back in over here and then you can double click to make reroute nodes to clean it up a little bit now we're going to set max block speed back to your normal walk speed foreign now we're going to get stamina Plus I'm going to do 0.03 then clamp that again and plug the max stamina in now we're going to set is sprinting to false get another branch get stamina and Max stamina foreign drag out into equals and then plug that into the branch now we want to set stamina off of the false plug that into the clamp and then update stamina then we want to delay into 0.5 another branch for his sprinting and then you want to grab the false and plug it in over here okay do the same thing for the rewrote nodes clean it up a little bit all right I'm going to move this up and then plug the back into the walk speed for released and then we're gonna go and make a widget blueprint user interface this is just going to be the progress bar get a canvas panel progress bar and anchor mine to the bottom change the size and location then I'm going to change the color and then we're going to go to the event graph you can name this underscore stamina so you know what it is get rid of the event tick and then you want to get player character cast to your third person character plug that in promote this to a variable then we're going to go down to the construct get your progress back drag it and do set percent plug that in get your third person character drag it get stamina plug that in and then you want to get your third person character again drag out of this and do the bind event to on stamina used plug that in drag out of the event and do a custom event just come update and then I'm going to copy these paste them back down here and plug that in there you go now you have a stamina system with sprinting setup I'm just going to add it to my HUD compile hit play now when I'm sprinting it'll go down and when it gets to zero it'll stop me from sprinting and it'll start to refill okay thanks for watching
Info
Channel: Fcb Dev
Views: 4,932
Rating: undefined out of 5
Keywords: unreal engine 5 tutorial, ue5 tutorial, unreal engine 5 tutorials, ue5 tutorials, unreal engine tutorials, unreal engine tutorial, unreal engine, tutorials unreal engine 5, unreal engine 5 stamina system, ue5 stamina system, ue5 stamina, unreal engine 5 stamina, ue5, ue5 stamina tutorial, ue5 stamina system tutorial, unreal engine 5 stamina system tutorial, unreal engine 5 stamina tutorial, ue5 make your own stamina system, unreal engine 5, stamina system unreal engine 5
Id: DkrQNrE_XEk
Channel Id: undefined
Length: 7min 1sec (421 seconds)
Published: Sat Sep 09 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.