diff options
author | tpart <tpart120@proton.me> | 2024-07-03 17:21:02 +0200 |
---|---|---|
committer | tpart <tpart120@proton.me> | 2024-07-03 17:21:02 +0200 |
commit | a4c0ac371157bf31ea0693b55b01d39b8d20cfb5 (patch) | |
tree | 0118efc3f6f9cb9676f3b99bdcdfb167ed90c7be | |
parent | 095db9be074577c0b46fa0ba080bfbd4f37c8f83 (diff) | |
download | hurrycurry-a4c0ac371157bf31ea0693b55b01d39b8d20cfb5.tar hurrycurry-a4c0ac371157bf31ea0693b55b01d39b8d20cfb5.tar.bz2 hurrycurry-a4c0ac371157bf31ea0693b55b01d39b8d20cfb5.tar.zst |
Fix lerp_angle() function
-rw-r--r-- | client/global.gd | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/client/global.gd b/client/global.gd index d9d5614b..30edbce5 100644 --- a/client/global.gd +++ b/client/global.gd @@ -192,5 +192,8 @@ func interpolate(current, target, dt): func interpolate_angle(current, target, dt): if abs(target - current) > PI: - target -= PI * 2 + if target < 0: + target += PI * 2 + else: + target -= PI * 2 return target + (current - target) * exp(-dt) |