Stamina system giving player energy based on how long moving in one direction?

Already have a stamina system, but how do I convert this into the new system? Thanks for any answers :slight_smile:

Ummm…what is this? You just posted a bunch of blueprint with a ton of random variables and functions and asked how one could convert this into something else equally as vague and confusing. You gotta do better than that if you want real answers. Please answer the following questions:

  1. What do you currently have (i.e. what does all this code “do” in your game)
  2. What is the overall goal you are trying to achieve
  3. What is the issue you are having specifically going from step 1 to step 2

That is how you should present your question to the community to get the best results.

Insted of using delays which are useless anyway the way you use them now add or substruct delta time (Delta Seconds) to energy and you can multiply or divide delta time to scale change of values as much as you want

Delta Time is time that passed between frames, so by adding you counting time that has passed or countdown by substructing

Thanks for the suggestion! What variables do I need to have to start building the new stamina system? Sorry i’m lost when it comes to tick events…

  1. This is my stamina system that checks how much energy is being used during the “Sprint” event as it’s held down (left shift)
  2. As stated in the original post, I want to allow the player to gain energy for abilities based on how long they have been sprinting in one direction. As the player sprints, they are gaining in speed. I also want to tick how fast they are moving as that determines how much energy charges up in the meter to use certain abilities in combat.
  3. My current stamina system only uses energy whenever I sprint and use abilities but doesn’t charge energy as i’m moving in one direction based on my current speed. (I don’t want sprint function to use any energy just abilities)

Clearly uninformed about tick events and such so i really need help. That critique was really unnecessary I was more than willing to answer any and all questions since i know this isn’t a normal stamina system.

I apologize if my critique offended you. I wouldn’t have written anything at all if I didn’t care to help. That being said, I see too many people post vague questions or questions that are clearly going to need more explaining to understand so my comment while blunt is really just me trying to help you frame your question in a way to get the best responses without spending 3 or 4 posts just gathering information. As for your question, you can use delta time as said, you can also use a timeline for something like this which I am a fan of because it allows you a lot of control over what is essentially a tick function. As for the whole running in one direction thing there are many more things that would be helpful to know. Like is this a 3D or 2D game? Either way you’ll likely need to get and store the players forward vector and then continuously compare it to the player’s current vector to see if it changes if not continue adding stamina etc. there is a lot to think about with your system it’s hard to just say “do this do that”. But those are my initial thoughts

Yes, I understand where you are coming from. I just thought since this is a forum to ask for help I would simply ask a question and receive a solution eventually. I didnt think its vagueness would bother anyone but i do understand it’s frustrating. I do appreciate your framework for a better idea of whati want to do with this system. Now it is a 3D third person action/free roam game as it’s based off “The Flash” and all i need him to do is to gain his stamina by running without stopping to turn as he gains speed he can gain more stamina to use his abilities so I need him to be able to store his energy in the progress bar and charge as he runs without having to slow down. I will look into making a timeline and use the delta time solution tomorrow. Thank you for your help!