Log In  
Follow
podfish

Just relaxing what are you up to?


Hey guys thought I would post this here as I think the answer will help other too:)
Basically I want to make a function that approaches any number in as big chunks as possible. Like this:

Speed = approach (target number, amount to move by)
So speed = approach(0, 0.5)
If speed was 0.4 before I want it to hit 0 and not -0.1

So if speed was a higher number like 7 every frame till it hits the target 0 it would take 0.5

Really useful for making velocity and stuff feel good :)
Any help very much appreciated :)

1
13 comments