When I let the object freefall without any obstructions it falls at a normal pace. However, when I drive off of a platform, it suddenly falls way faster. Why is this happening and how do I fix this?
public class ShipPhysics : MonoBehaviour
{
public float MaxSpeed;
public float Acceleration;
public float Deceleration;
public float Drag;
public float Turning;
public float MaxBackwardsSpeed;
public float Speed;
public Rigidbody rb;
void Update()
{
if (Input.GetAxis("Vertical") > 0 && Speed < MaxSpeed)
{
Speed += Acceleration * Time.deltaTime;
}
if (Speed > MaxSpeed)
Speed = MaxSpeed;
if (Input.GetAxis("Vertical") < 0 && Speed > MaxBackwardsSpeed && Speed > 0)
{
Speed -= Deceleration * Time.deltaTime;
}
if (Input.GetAxis("Vertical") < 0 && Speed > MaxBackwardsSpeed && Speed < 0)
{
Speed -= Acceleration * Time.deltaTime;
}
if (Speed < MaxBackwardsSpeed)
Speed = MaxBackwardsSpeed;
if (Input.GetAxis("Vertical") == 0 && Speed > 0)
{
Speed -= Drag * Time.deltaTime;
}
rb.velocity = transform.forward * Speed * -1 + new Vector3(0, rb.velocity.y, 0);
rb.angularVelocity = Vector3.zero;
transform.Rotate(0, Turning * Input.GetAxis("Horizontal") * Time.deltaTime, 0);
rb.angularVelocity = Vector3.zero;
}
}```
<@&823670198958948373>