void Landing_Update()
 {
     if (!_freefall)
     {
         Flying3DObjectComponent.ApplyVerticalThrust(false);
     }
     if (GroundProximityCheckerComponent.IsAlmostTouching())
     {
         FSMFlyable.ChangeState(FStatesFlyable.NotFlying);
     }
 }
Example #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;
            }
        }
Example #3
0
        /*
         * public bool IsFarFromGround()
         * {
         *  return GroundProximityCheckerComponent.IsWithinRayDistance() == null;
         * }
         */

        public bool IsCloseToGround()
        {
            return(GroundProximityCheckerComponent.IsWithinRayDistance() != null);
        }
Example #4
0
 public bool IsCloseToNavMeshSurface(float value, out NavMeshHit hit)
 {
     _surfaceDistance = GroundProximityCheckerComponent.IsWithinRayDistance(out hit);
     return(_surfaceDistance != null && _surfaceDistance.Value <= value);
 }
Example #5
0
 public float?IsCloseToNavMeshSurface(out NavMeshHit hit)
 {
     return(GroundProximityCheckerComponent.IsWithinRayDistance(out hit));
 }
Example #6
0
 public float?IsCloseToSurface()
 {
     return(GroundProximityCheckerComponent.IsWithinRayDistance());
 }