summaryrefslogtreecommitdiff
path: root/DragHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'DragHandler.cs')
-rw-r--r--DragHandler.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/DragHandler.cs b/DragHandler.cs
new file mode 100644
index 0000000..adb8df4
--- /dev/null
+++ b/DragHandler.cs
@@ -0,0 +1,25 @@
+using UnityEngine;
+
+public class DragHandler : MonoBehaviour
+{
+ private float drag;
+
+ private float angularDrag;
+
+ private Rigidbody rig;
+
+ public float dragAmount = 1f;
+
+ private void Start()
+ {
+ rig = GetComponent<Rigidbody>();
+ drag = rig.drag;
+ angularDrag = rig.angularDrag;
+ }
+
+ private void Update()
+ {
+ rig.drag = drag * dragAmount;
+ rig.angularDrag = angularDrag * dragAmount;
+ }
+}