void ExertForce() { currentThrust = thrustpercent * maxThrust * 1000f; Vector3 thrustVector = thrustUnitVector.normalized * currentThrust; // [N] physicsEngine.AddForces(thrustVector); }
void FixedUpdate() { Vector3 velocityVector = physicsEngine.velocityVector; float speed = velocityVector.magnitude; float dragSize = CalculateDrag(speed); Vector3 dragVector = dragSize * velocityVector.normalized; physicsEngine.AddForces(-dragVector); // dragVector is applying in the opposite direction }