//...use this one private void FixedUpdate() { if (engine_on) { CheckSpeedChange(); //hover off ground DoHover(); //forward/backward ApplyThrust(); //ascend up and down ModifyHoverHeight(ascend_amount); //set angle DoTiltAngle(ascend_amount); Rotate(); car_rb.transform.eulerAngles = new Vector3(current_tilt, car_rb.transform.rotation.eulerAngles.y, current_rotate); } //turn left and right car_rb.AddRelativeTorque(0f, HoverControlScheme.InputStateToInt(controls.turn_input) * turn_speed, 0f); DoAngularVelocityBreak(); }
private void ApplyThrust() { if (driverActions.Accelerate.IsPressed) { car_rb.AddRelativeForce(0f, 0f, GetSpeedModifier() * HoverControlScheme.InputStateToInt(controls.power_input) * thruster_speed); } else if (driverActions.Reverse.IsPressed) { car_rb.AddRelativeForce(0f, 0f, GetSpeedModifier() * HoverControlScheme.InputStateToInt(controls.power_input) * reverse_speed); } }
private void Awake() { car_rb = GetComponent <Rigidbody>(); controls = GetComponent <HoverControlScheme>(); DoControlBindings(); }
private void Awake() { controls = GetComponent <HoverControlScheme>(); }