summaryrefslogtreecommitdiff
path: root/CenterOfMass.cs
diff options
context:
space:
mode:
Diffstat (limited to 'CenterOfMass.cs')
-rw-r--r--CenterOfMass.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/CenterOfMass.cs b/CenterOfMass.cs
new file mode 100644
index 0000000..9acb727
--- /dev/null
+++ b/CenterOfMass.cs
@@ -0,0 +1,14 @@
+using UnityEngine;
+
+public class CenterOfMass : MonoBehaviour
+{
+ private void Start()
+ {
+ Rigidbody componentInParent = GetComponentInParent<Rigidbody>();
+ componentInParent.centerOfMass = componentInParent.transform.InverseTransformPoint(base.transform.position);
+ }
+
+ private void Update()
+ {
+ }
+}