// Start is called before the first frame update void Start() { car = GetComponent <Car>(); engine = transform.GetComponent <CarEngine>(); _rigidbody = engine.GetComponentInChildren <Rigidbody>(); colliders = transform.GetComponentInChildren <CarColliders>(); particles = transform.GetComponentInChildren <ParticleManager>(); POWER = (1f / 2f) * car.GetBoost(); AMOUNT = 200f + 3f * car.GetBoostAmount(); realAmount = AMOUNT; TIME_TO_MAX = (1f / 100f) * car.GetBoostTimeToMax(); }
private void Awake() { //Debug.Log("Client"); car = GetComponent <Car>(); _rigidbody = GetComponent <Rigidbody>(); _rigidbody.centerOfMass = centerOfMass.localPosition; colliders = transform.GetComponentInChildren <CarColliders>(); wheels = GetComponentInChildren <WheelsManager>(); maxSpeed = 2 * car.GetSpeed(); MOTOR_TORQUE = 3350f + 1.5f * car.GetPower(); MAX_STEER = car.GetSteer(); }