using UnityEngine; public class RocketController : MonoBehaviour { public RocketDataScript rocketData; private Rigidbody rb; // Start is called once before the first execution of Update after the MonoBehaviour is created void Start() { rocketData.SetThrustLever(0); rocketData.SetFuel(100); rb = GetComponent(); var mass = 0f; foreach (var item in transform.GetComponentsInChildren()) { mass += item.mass; } rocketData.SetMass(mass); ////rb.mass = mass; } // Update is called once per frame void Update() { ////if (rocketData.Thrust > 0) ////{ //// rb.AddForce(rocketData.Thrust * Time.deltaTime * transform.up); //// rocketData.AddFuel(-1 * Time.deltaTime); ////} } }