How to disable sprint when Aiming

Hello, I am currently working in the top down template( if that even matters) and I am wondering how I would go about setting this up. Below are my function builds for both sprint and speed change while ads, but I dont know if I should somehow link them together, or how I would go about it. Also attached below, is my function for Stand/Crouch/Prone function. I add this because I feel like I could implement the same kind of logic for my Aim while Sprinting problem. I just cant figure it out on my own.
Much love

319257-sprintfunction.png

How to disable sprint when Aiming

Would that work for you:

Essentially, for as long as the aiming flag is True, sprint speed is the same as walk speed

If you ever wish to achieve something more advanced and combine multiple states resulting in different speeds as in: sprinting backwards underwater with a broken leg while prone & encumbered, you could look into bitmasks:

Otherwise, you may need to keep dealing with branching cascading spaghetti trees. Kind of depends on how complex things are going to get. Booleans might be enough if it’s just a few states affecting a variable.

Nevermind, Worked a charm for the most part, except, if I ADS while sprinting, sprint stays true. I dont want to just be spoon fed because im really trying to learn ha, ill tinker with it a bit and see, thanks again!

Thankyou so much for your fast input, I tried this and I have a compile error, so im going to do some research on character movement components and try again <3

if I ADS while sprinting, sprint stays
true.

Perhaps it’s enough to Set Max walk speed to 300 when the RMB is pressed. Admittedly, there’s probably many ways to get there:

Good luck!