private IEnumerator TryToWander()
    {
        while (true)
        {
            yield return(new WaitForSeconds(Random.Range(5, _coroutineCooldown)));

            if (_character.CommandProcessor.HasTask == true)
            {
                continue;
            }

            Node targetNode = null;
            Node startNode  = _character.MotionComponent.Node;

            while (targetNode is null)
            {
                Vector3    randomPosition = Random.insideUnitSphere * _searchOffset;
                Vector2Int checkPosition  = new Vector2Int((int)(startNode.X + randomPosition.x), (int)(startNode.Y + randomPosition.y));
                Node       checkNode      = Utils.NodeAt(checkPosition);
                if (checkNode == null)
                {
                    continue;
                }

                if (Pathfinder.CompareCharacterRegionWith(_character, checkNode.Region))
                {
                    targetNode = checkNode;
                    break;
                }
                //this waiting is needed for situations when character is surrounded by not traversable objects.
                yield return(new WaitForSeconds(10));
            }

            Task wanderTask = new Task();
            wanderTask.AddCommand(new MoveCommand(_character.MotionComponent, targetNode.Position));
            wanderTask.AddCommand(new WaitCommand(_idleWaitTime));

            _character.CommandProcessor.AddTask(wanderTask);
        }
    }