using UnityEngine; public class RopeAdditionalParams : MonoBehaviour { public bool updateOnStart; public float nodeMass = 1f; public float nodeDrag = 1f; public float nodeAngularDrag = 1f; private void Start() { if (updateOnStart) { UpdateNodes(GetComponent()); } } public void UpdateNodes(UltimateRope rope) { for (int i = 0; i < rope.RopeNodes.Count; i++) { UltimateRope.RopeNode ropeNode = rope.RopeNodes[i]; GameObject[] segmentLinks = ropeNode.segmentLinks; foreach (GameObject gameObject in segmentLinks) { Rigidbody component = gameObject.GetComponent(); component.mass = nodeMass; component.drag = nodeDrag; component.angularDrag = nodeAngularDrag; } } } }