Im working on the basic controls and physics for my flying game.
When i reduce throttle to zero the plane stops on x/z and starts falling on the y axis, but it falls very very slowly when compared to a single cube, i have a single rigidbody on a game object which all the plane parts are parented too.
Both the cube and the planes RB have the same settings so why is it falling so much slower? As far as i cant tell if im not touching W/S my code wont touch the planes y axis.
Plane Controll Functions
void ThrottleControl(int direction)
{
// Adjust enginePower
enginePower += direction * throttleResponse * Time.deltaTime;
// Clamp the engine power between the minimum and maximum values
enginePower = Mathf.Clamp(enginePower, minEnginePower, maxEnginePower);
Debug.Log("Engine Power: " + enginePower);
}
void VelocityControl()
{
// Move forward with limited max speed
currentVelocity = transform.forward * enginePower;
currentVelocity = Vector3.ClampMagnitude(currentVelocity, maxVelocity);
rb.velocity = currentVelocity;
Debug.Log("Velocity: " + rb.velocity);
}
void AttitudeControl(float horizontalInput, float verticalInput)
{
// Yaw, Pitch & Roll
yaw += horizontalInput * yawAmount * Time.deltaTime;
pitch = Mathf.Lerp(0, 20, Mathf.Abs(verticalInput)) * Mathf.Sign(verticalInput);
roll = Mathf.Lerp(0, 30, Mathf.Abs(horizontalInput)) * Mathf.Sign(-horizontalInput);
// Apply rotation
transform.localRotation = Quaternion.Euler(Vector3.up * yaw + Vector3.right * pitch + Vector3.forward * roll);
}
Pictures of planes object setup and RB settings below