Rodney McGruder, right, with Heat teammate James Johnson, is finally settling into NBA life. (Alan Diaz/AP)

One day in September 2014, Rodney McGruder was shooting around inside Boston’s TD Garden, when Danny Ainge, the Celtics’ general manager and president of basketball operations, approached the training camp invitee who was trying for the second time in as many years to make an NBA roster.

As McGruder remembers it, seemingly out of nowhere, Ainge said, “You’re going to be an NBA player. I don’t know if it’s going to be here or where but you will be.”

McGruder is indeed now an NBA player, a swingman for the Miami Heat who missed making the NBA all-rookie team last season by two votes, causing Heat Coach Erik Spoelstra to say he was “extremely disappointed” in the lack of recognition. Miami hosts the Washington Wizards in a preseason game Wednesday, an exhibition that should hold extra meaning for McGruder — he is originally from Landover and played three years at Archbishop Carroll.

(Kelvin Kuo/USA TODAY Sports)

But McGruder’s path to the NBA was one of persistence and perseverance. He wasn’t a lottery pick or a sought-after free agent. Before finally breaking through as a 25-year-old rookie last season, McGruder had to earn his place, bouncing around from team to team, continent to continent.

Despite being named an honorable all-American his senior year at Kansas State, McGruder went undrafted in 2013. He played in Hungary for a season, then came back and churned through the NBA D-League and Summer League for two seasons before finally earning his spot as one of the last players to make the Heat.

“I love his path,” said Spoelstra, who started McGruder in 65 of his 78 games last season. “I love how he’s gotten to where he’s gotten. I love his internal character and fortitude.”

McGruder never shied away from criticism. He welcomed it. He always asked questions: What do I need to do to get better? What do I need to do to make it to the NBA?

“Rodney would take those answers, process it and address those things,” his agent Joel Bell said. “That why Rodney made it.”

Around the time McGruder was waived by the Oklahoma City Thunder before the start of the 2013 season, Bell ran into McGruder’s father at a grocery store. McGruder had just fired his former agent because, McGruder said, “I just felt like it was for my best interest.”

Bell is from the area, and had always been a fan of McGruder during his Archbishop Carroll days. Bell met with McGruder to come up with a plan for the next step in McGruder’s career.

“We talked about what was best for him,” Bell said. “The pros and cons of playing over there is you make the money, but you’re not going to get [an NBA] call up from Europe.”

McGruder averaged 14.4 points and 5.3 rebounds in 29 games in Hungary in 2013-14. The following summer, McGruder played in the NBA Summer League with the Golden State Warriors. A month later, he signed a non-guaranteed contract with the Celtics but was cut again. He signed with the Celtics D-League team, the Maine Red Claws, four days later.

McGruder had a rough time with the Red Claws: He missed the first two months of the season because of a groin injury. He returned in January, but was unhappy with his playing time. In March, McGruder asked the Red Claws to release him. But now Rodney had no team, and again his dream seemed like it was fading.

He remembered what Ainge told him. It comforted him.

“Even when things got rough I thought about that,” McGruder said. “Danny Ainge has been associated with the NBA for a long time, and for him to say that, I didn’t think he was blowing smoke.”

He signed with the Heat’s D-League team, the Sioux Falls Skyforce a few days later and appeared in seven games. That summer, McGruder played for the Heat’s summer league team, coached by Dan Craig, who soon gave McGruder an important second opinion.

After playing in the Summer League, McGruder wasn’t invited to training camp with the Heat. In September, Craig called him to tell him he was going to be coach of the Skyforce the following season.

“I liked playing for him in the summer,” McGruder said, “so I decided to play with him in the D-League.”

During that call, Craig also told McGruder, “You have what it takes to make it to the NBA.”

During the 2015-16 season with the Skyforce, McGruder blossomed, averaging more than 15 points per game and leading his team to the D-League championship.

“When he was on the floor, good things were happening,” Spoelstra said.

McGruder again received an invitation to be on the Heat’s summer league team. This time he was invited to training camp.

“He was not necessarily a long shot, but it was very competitive,” Spoelstra said. “But he was one of our most improved players.”

A few days after training camp ended on Oct. 1, 2016, McGruder went to Florida Atlantic University to watch a scrimmage. He sat in the gym, anxiously waiting for a call from Bell to let him know if he had made the team.

After sweating-out an hour, Bell finally called, and McGruder stepped outside. “You made it,” McGruder recalled Bell telling him. McGruder called his parents on FaceTime. Soon after, his older siblings and other friends started reaching out. But before he got back to everyone, McGruder looked up at the sky and reflected on the journey that sent him to Hungary, Maine, South Dakota and, at long last, Miami.

More NBA:

In sickness and in health: 76ers take a risky, expensive plunge on Joel Embiid

Dwyane Wade to start at shooting guard for Cavaliers, sending J.R. Smith to the bench

Dante Exum, once the Jazz’s point guard of the future, remains as enigmatic as ever