void Landing_Update()
 {
     if (!_freefall)
     {
         Flying3DObjectComponent.ApplyVerticalThrust(false);
     }
     if (GroundProximityCheckerComponent.IsAlmostTouching())
     {
         FSMFlyable.ChangeState(FStatesFlyable.NotFlying);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Check if the Bot is in a position of falling/landing
        /// </summary>
        public void HandleFailling()
        {
            if (_IsNetworkPeer)
            {
                return;
            }

            if (CurrentStatesGround != StatesGround.GROUNDED_NAVMESH_SUCCESS)
            {
                if (CheckForGround())
                {
                    Land();
                }
                else if (GroundProximityCheckerComponent.IsAlmostTouching(false))
                {
                    CurrentStatesGround = StatesGround.GROUNDED_NAVMESH_FAIL;
                }
            }
            else if (!CheckForGround() && !GroundProximityCheckerComponent.IsAlmostTouching(false))
            {
                CurrentStatesGround = StatesGround.NOTGROUNDED;
            }
        }