[Solved] How to match different stance speeds?

Hello, I’ve recently been into developing a stealth game just like Splinter Cell with variable speeds and stuff. I got the variable speeds down easily for both standing and crouch, so I decided to expand it a little further by making one stance affect the other. I have 4 variable speeds for each stance.

So I want, for example, when I walk with speed 1, to crouch with speed 1 when I push the crouch button. Then if while crouching I decide to change my crouching speed to 4, when I get up to walking stance I want to walk with speed 4 and so on.

When I wrote this script I was 100% sure it’d work, because it makes complete sense to me… but it doesn’t work, so what I am I doing wrong?

Details (to avoid confusion with the numbers):

Walking | Speed 1 = 93.75---------------------------------------------------------------------------------------Crouching | Speed 1 = 140
Walking | Speed 2 = 187.5---------------------------------------------------------------------------------------Crouching | Speed 2 = 170
Walking | Speed 3 = 281.25-------------------------------------------------------------------------------------Crouching | Speed 3 = 200
Walking | Speed 4 = 375------------------------------------------------------------------------------------------Crouching | Speed 1 = 230

First couple of screenshots are for decelerating & the latter two for accelerating.

[Edit: The script is working. The print string values I was getting were wrong.]

You could try using a series of ‘select float’ nodes instead, switching to the value for each “speed” mode.