summaryrefslogtreecommitdiff
path: root/ActiveRagdoll/Assets/TABG/Scripts/Animation/DragHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ActiveRagdoll/Assets/TABG/Scripts/Animation/DragHandler.cs')
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Animation/DragHandler.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Animation/DragHandler.cs b/ActiveRagdoll/Assets/TABG/Scripts/Animation/DragHandler.cs
new file mode 100644
index 0000000..7528f57
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Animation/DragHandler.cs
@@ -0,0 +1,33 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Rigging.Animations
+{
+
+ 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;
+ }
+ }
+
+}