Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        private void FixedUpdate()
        {
            var gravityF = _gravitySystem.GetGravityForce(_testRocket);

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