////////////////////////////////////////////////// void Start() { body = GetComponent <Rigidbody> (); physics = GetComponent <car_physics> (); drive_engine = GetComponent <Drive_Engine> (); hover_engine = GetComponent <Hover_Engine> (); stabilizers = GetComponent <Stabilizers> (); if (physics.runner_controls) { turning_physics = Turning_Physics.strafing; } else { turning_physics = Turning_Physics.angular_velocity; } // turning if (turning_physics == Turning_Physics.constant_local_rotation) { rotation_multiplier = 1.3f; } else if (turning_physics == Turning_Physics.constant_global_rotation) { rotation_multiplier = 1.3f; } else if (turning_physics == Turning_Physics.relative_torque) { rotation_multiplier = 500f; } else if (turning_physics == Turning_Physics.speed_based) { if (drive_engine.forward_physics == Drive_Engine.Forward_Physics.move_position) { rotation_multiplier = 2.5f; } if (drive_engine.forward_physics == Drive_Engine.Forward_Physics.set_velocity) { rotation_multiplier = .03f; } if (drive_engine.forward_physics == Drive_Engine.Forward_Physics.add_relative_force) { rotation_multiplier = .1f; } } else if (turning_physics == Turning_Physics.strafing) { horizontal_speed_max = 25f; horizontal_acceleration = 3f; } }
private void Start() { //Get references to the Rigidbody and PlayerInput components _rigidBody = GetComponent <Rigidbody>(); _input = GetComponent <PlayerInput>(); _booster = GetComponent <BoostingController>(); _stabilizers = GetComponent <Stabilizers>(); //Calculate the ship's drag value _drag = _driveForce / _terminalVelocity; _isOnGround = _stabilizers.Raycast(out _lastInfo); }