summaryrefslogtreecommitdiff
path: root/GameCode/MoveTransformGravity.cs
diff options
context:
space:
mode:
Diffstat (limited to 'GameCode/MoveTransformGravity.cs')
-rw-r--r--GameCode/MoveTransformGravity.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/GameCode/MoveTransformGravity.cs b/GameCode/MoveTransformGravity.cs
new file mode 100644
index 0000000..fd822fe
--- /dev/null
+++ b/GameCode/MoveTransformGravity.cs
@@ -0,0 +1,23 @@
+using UnityEngine;
+
+public class MoveTransformGravity : MonoBehaviour
+{
+ public float amount = 1f;
+
+ public float pow = 1.5f;
+
+ private MoveTransform move;
+
+ private float counter;
+
+ private void Start()
+ {
+ move = GetComponentInParent<MoveTransform>();
+ }
+
+ private void Update()
+ {
+ counter += TimeHandler.deltaTime;
+ move.velocity += Vector3.down * Mathf.Pow(amount * counter, pow);
+ }
+}