2 BP related questions (doesnt work properly)

Hello,
Im encountering a problem which is bothering me and i cannot seem to fix it myself… tried some other ways but didnt work…
First of all, let me explain what i want it happend, and what actually happens…

Variables used:
Walkspeed = Defines the walkspeed,
MinWalkScrollSpeed = What the minimum walkspeed is with scrolling,
MaxWalkScrollSpeed = the same but it is giving the max walkspeed that can be chosen when scrolling,

What is supposed to happen?
I want the user to be able to control the Movement speed precisely due to tactical purposes.

What actually happens
The MinWalkScrollSpeed is working as intended, but the MaxWalkScrollSpeed is not setting the limit on whats the Max scrollable walkspeed… and the user has to sprint once for the Game to “refresh” it otherwise the Movement speed will stay the same as before.

[Heres a preview][1]

Max returns the maximum value. I think you want to use Clamp to limit the variable - do it after + / - 50 and then Set Walkspeed.

Not sure if there’s a second question here. Do tell.

Not sure if there’s a second question here. Do tell.

Was abit unclear probably, my second question was how to fix it not “refreshing” / having an instant effect on the movement speed change… also thanks, forgot about the good ol’ clamp… (for some reason its hard for me to find fixes for easy things, but easy to find fixes for hard things…)

having an instant effect on the
movement speed change

Not sure if I follow. You set your max speed with mouse wheel. Do you want to apply this speed to something else now?

No, after lets say i increase my speed, it doesnt instantly apply the speed change, i always need to use my sprint function for the change to be applied. (In the video the sprinting function represents the value 700)

I don’t know how you built your game. How does your sprint apply the speed?

It is pretty basic, takes the InputAction then sets the speed depending on if Pressed or released… have a stamina check aswell but unsure if it even effects it [screenshot-1]

This is the StaminaCheck, it uses DeltaSeconds to check if the Stamina == 0[staminacheck]

So what is stopping you from applying your mouse wheel modified Walkspeed as character movement component’s walk speed?

You can do it directly, too, without the extra variable on the mouse wheel - have the mouse wheel modify the component’s value.

Also, using Delay in Tick is not a good scripting practice. Is it necessary?

Im very unsure what causes this, tried deleting the entire Stamina + sprint function (since notthing has any refrence to it) and it still didnt apply the speed on scroll… im gonna sleep a night over it, i may find a fix tomorrow since im tired…

When you use mouse wheel, apply the value to the component’s walk speed, the same way you do in the sprint.


Alternatively, have Tick pull the value the mouse wheel sets and apply it.

Well, thanks… i can be stupid when im tired… thanks for taking the time out of your day! i appreciate it!

No worries.

Good luck with the rest!