I’m super fresh with learning Unreal so this is probably jumping way too far into the deep end but I really want to try and figure this problem out.
I’ve been trying to replicate the stamina system in this tutorial
I want to implement this for first-person game instead though.
I’ve got to a point where I’ve replicated everything in the tutorial but for some reason, my stamina isn’t regenerating. I also can’t run again once I’ve activated sprint once.
Changing the ‘Mesh’ node to ‘First Person Mesh’ fixes this but I’m wondering if this is part of my problem because the 3rd person template doesn’t have these 2 different meshes.
This is my input mapping Blueprint, which I believe is slightly different to the 3rd person default too.
Can you show all of your code starting with your run_roll_avoid event? That includes the insides of any custom functions. Get that to us and we’ll take a look, I see this quite a lot. Don’t worry, it’s usually a quick fix, and a symptom of looking at your own code for too long.
Get that back to us and let’s get you sprinting along!
The GAS system is great for things like this. Building an attribute and effect system in c++ makes it pretty is easy to implement and replicate in BP. It’s more than I will explain here but I follow Alamars Dev Domain on YouTube. His series on GAS, especially the top down shooter one is a really easy and good start for setting this up if your not afraid to dive into some c++
Thanks so much. Unfortunately, as a new user, it’s only letting me include one picture per post so let’s start with the run_roll_avoid event and I’ll try post everything else separately, as annoying as that is
I actually did a report on this stamina system back in the day for an applied maths course, so I’m able to follow this logic pretty easily! The Soulsborne stamina system is not your typical one so I see why you’d need all the extra parts.
I think your problem lies here, in the input. This is ONLY running the Completed line once, when you let go of the button. If you let go of the button before a montage completes it returns “True” and then it never sets the ENUM back to “None”, keeping you from increasing speed again AND preventing stamina recovery. Try connecting the “True” line to the Set Enum node as well and test it.
Try to scroll to the right with those errors so we can actually locate them. You can click on any of the errors where there’s a magnifying glass and it will take you right to the issue at hand!
Because in the Soulsborne system of stamina if you have even 1 point of stamina you can execute any stamina consuming move, but because of the delayed recovery it really simulates struggling and being winded quite well. Though personally, I’d just clamp it before setting instead of setting it to 0 directly after.
Thanks so much for getting back and no worries at all!
Here’s the rest of the error message but maybe worth noting that I don’t get the error if I switch the Anim Instance target mesh out for the First Person Mesh. Doing that though, I still have the problem of stamina not regenerating.
So it’s a “Get AnimInstance” function needed for a specific Branch node on the player character’s Event Graph. Which means unless you have another one somewhere, this is the problem right here. Maybe just go around this node, bypass that branch completely for now.
Because of this error it couldn’t get through that branch, therefore it couldn’t set the Enum to none(which would allow you to sprint again), and it couldn’t start the regeneration macro!
Alright! I’ve tried bypassing that branch as well as connecting both true and false at the same time. Still no luck.
Going back to how it was originally set, with just False connected, I added a Print String to the end of the Handle Stamina Regen macro. That’s printing when I let go of sprint.
I then followed the bouncing ball to the Refresh Stamina Regeneration event and added a Print String in between the looper and the Stamina Regen Tick. That’s also printing, over and over again when I let go of sprint. As expected.
So am I right in thinking this has something to do with the Stamina Regen Tick?