Exemple #1
0
        private void ApplyForces(Rocket rocket, float deltaTime)
        {
            var gravityForce      = _gravitySystem.GetGravityForce(rocket.Rb);
            var flyDir            = rocket.Rb.transform.forward;
            var accelerationForce = flyDir * rocket.Acceleration * rocket.Rb.mass;
            var resultForce       = accelerationForce + gravityForce;

            rocket.Rb.UpdateVelocity(resultForce, deltaTime);
        }
        private void FixedUpdate()
        {
            var gravityF = _gravitySystem.GetGravityForce(_testRocket);

            _testRocket.UpdateVelocity(gravityF, Time.fixedDeltaTime);
        }