E
For example, in movement: if the speed variable is not rounded or floored (I forgot how it's called), it can twitch to make the hspeed value equal 0, but can not do it.what are you doing presently that is responsible for that twitching?
Remember to post your code so we don't have to guess at what is going on.I want to slowly "move" my value from, for example: 2 to 0 without "this":
View attachment 20575
Sometimes, values that need to slowly decrease or increase are starting to "twitch", trying to get into a certain interval or position.
How to fix it?
I'm asking lerp function analogues that works perfectly.Remember to post your code so we don't have to guess at what is going on.
//Create
startValue = 0;
targetValue = 100;
speedFactor = 0.2;
//Step
startValue += speedFactor * (targetValue - startValue);
//Or alternatively like this:
startValue = lerp(startValue, targetValue, speedFactor);
I'm not sure I understand. lerp does work perfectly. It does exactly what it is supposed to every time. If you're getting unexpected results then there is something in your code, which is why you should post it.I'm asking lerp function analogues that works perfectly.