E
Edwin
Guest
Hello, people I have this script that creates smooth approaching:
This code makes smooth approaching but current will be faster depending of target distance. How I can just clamp the speed of it?
Code:
var distance = target - current;
if (abs(distance_x) > 0.1) {
current += ( target - current ) * speed;
} else {
current = target;
}