Topic was automatically imported from the old Question2Answer platform.
Asked By
Macryc
Hi. My math gaps have caught up with me, please help.
I have a speed range that goes from 0 to 5 (0 stop, 5 - run).
I want to transpose it onto a range between -1 to 1, so that I can use the speed value to control an animation blend3 which goes from -1 to 1 in my animation tree.
Basically, the blend3 blends 3 anims: idle(-1), walk(0), run(1). I want the blend position of this blend to be set my the speed value.
In math/Godot how do you transpose/translate a range of 0 to 5 onto -1 to 1?
var ranging = []
for i in range(6):
ranging.append(i)
print(ranging)
#Divide by 2.5
#Then -1
for i in range(ranging.size()):
ranging[i] = ranging[i]/2.5 - 1
print(ranging)