My game has a character that accelerates slowly as it walks. Is it possible to set a minimum walk speed for it as opposed to a maximum without C++?
I was just trying to figure this out also and Clamping didn’t work well enough, but I found another way.
I got it working with some extra variables that are used to adjust the axis value.
I took the axis value from the input event, and used a series of Branch nodes, to see if the value is above or below the minimum speed I was looking for.
If it’s above 0 and below .5 for example, it’s too slow, so I have a variable set to .5.
If it’s below 0 and above -.5, It’s too slow, so I have a variable set to -.5.
.5 or -.5 are the minimum walk speeds in this example.
If it’s above that too slow range, use whatever the axis value is directly from the event node.
I have a MySpeedRange variable that is used for the final value that is plugged in to the movement input node.
I also have a Minimum speed Variable, so I can use that to set MySpeedRange, if it needs to use it. So I don’t have to change each Branch test for it, I can just tweak the one Minimum speed variable and be done with it.
On the Negative ranges, I just have that Minimum speed variable multiplied by -1, and the result plugged in to the MySpeedRange variable.
With that I was able to set my Min and Max walk speeds to go from 0, skip to .5 and blend from .5 to 1.