summaryrefslogtreecommitdiffstats
path: root/SmoothRotation.gd
diff options
context:
space:
mode:
authordusoleil <howcansocksbereal@gmail.com>2022-07-23 13:26:21 -0400
committerdusoleil <howcansocksbereal@gmail.com>2022-07-23 13:26:21 -0400
commit0823c295a3b03d98be356b239a3f74f05795d9c9 (patch)
treeddc52f71ee5a3ecf08b38c100812fe147417a297 /SmoothRotation.gd
parent4486f3ace302e709e2cea6329931869438456d69 (diff)
downloadchicken-chaser-gd-0823c295a3b03d98be356b239a3f74f05795d9c9.tar.gz
chicken-chaser-gd-0823c295a3b03d98be356b239a3f74f05795d9c9.zip
Smooth Rotation of Chickens
Diffstat (limited to 'SmoothRotation.gd')
-rw-r--r--SmoothRotation.gd7
1 files changed, 7 insertions, 0 deletions
diff --git a/SmoothRotation.gd b/SmoothRotation.gd
new file mode 100644
index 0000000..f6df8c7
--- /dev/null
+++ b/SmoothRotation.gd
@@ -0,0 +1,7 @@
+extends Tween
+
+func rotate_y(ang, speed):
+ var parent = get_parent()
+ remove_all()
+ interpolate_property(parent, "rotation:y", parent.rotation.y, parent.rotation.y+ang,abs(ang/speed),Tween.TRANS_EXPO,Tween.EASE_OUT)
+ start()