public override void UpdateFunc() { if (AttachedTo != null) { AttachedTo.MoveNode(Trans.forward * Force * Time.deltaTime); } Model.Rotate(new Vector3(0, 0, -Force * Time.deltaTime * 2000), Space.Self); }
public override void UpdateFunc() { if (AttachedTo != null && AttachedTo.FixedPosition == false) { Vector3 vec = AttachedTo.Position - AttachedTo.LastPosition; float speedFactor = Mathf.Pow(vec.magnitude / Time.deltaTime, 2); float angleFactor = Vector3.Dot(vec.normalized, Trans.up); AttachedTo.MoveNode(Trans.up * Drag * speedFactor * -angleFactor * Time.deltaTime); } }