aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortpart <tpart120@proton.me>2024-07-03 17:21:02 +0200
committertpart <tpart120@proton.me>2024-07-03 17:21:02 +0200
commita4c0ac371157bf31ea0693b55b01d39b8d20cfb5 (patch)
tree0118efc3f6f9cb9676f3b99bdcdfb167ed90c7be
parent095db9be074577c0b46fa0ba080bfbd4f37c8f83 (diff)
downloadhurrycurry-a4c0ac371157bf31ea0693b55b01d39b8d20cfb5.tar
hurrycurry-a4c0ac371157bf31ea0693b55b01d39b8d20cfb5.tar.bz2
hurrycurry-a4c0ac371157bf31ea0693b55b01d39b8d20cfb5.tar.zst
Fix lerp_angle() function
-rw-r--r--client/global.gd5
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)