NASHVILLE, Tenn. — The suspect in a deadly Waffle House shooting was ordered Wednesday to receive treatment in a mental facility for schizophrenia in hopes that he becomes fit to stand trial.

Travis Reinking, 29, learned his fate in court just feet away from the man who authorities say wrestled an assault-style rifle away during the April shooting in Nashville that killed four people. It was the first time James Shaw Jr. saw Reinking since the act of heroism that has since landed him budding celebrity status.

Dozens of those close to the victims also were on hand, many wearing matching memorial shirts for their fallen family members and friends.

Davidson County Criminal Court Judge Mark Fishburn said Reinking poses a substantial threat of harm to the public, if not himself.

James Shaw Jr., second from left, leaves the courtroom after a hearing for Travis Reinking Won Aug. 22, 2018, in Nashville, Tenn. Shaw wrestled the gun away from Reinking, who is charged with killing four people during a shooting at a Waffle House restaurant in Nashville in April. Mark Humphrey / AP

Wearing a yellow jail jumpsuit, Reinking remained quiet until the end of the hearing, when he seemed to begin saying something about his "religion" before a court officer and his public defender stopped him from speaking.

Shaw, who has been hailed as the hero who disarmed the gunman during the April 22 shooting, wore a T-shirt and shorts as he watched the proceedings from the audience. He gave a few hugs on his way out and did not speak to reporters.

Reinking was nearly naked and wearing only a green jacket when he opened fire outside the restaurant with an assault-style rifle and then stormed the Waffle House, police have said.

Forensic psychologist Rena Isen testified Wednesday that Reinking is currently unfit for trial, saying Reinking isn't complying with his medication, which could potentially treat his illness.

Victims' relatives and friends groaned and mumbled at the testimony, and some were on the verge of tears.

Updates on Reinking's condition are due every six months, though if he becomes fit to stand trial, Fishburn said to notify him immediately.

The judge instructed the mental facility to "take whatever measures are reasonably necessary to see that he becomes and retains competency so that the trial in the case can proceed."

Di'Angelo Groves, whose sister DeEbony Groves died in the shooting, told reporters that he was "totally at peace" because seeing Reinking was a part of his grieving process. Groves said he thought Reinking looked ill.

"I'm not angry. I'm not upset at all," Groves said, adding that Reinking "needs help."

Reinking had a record of odd behavior.

Reinking was detained by the Secret Service in July 2017 after he ventured unarmed into a forbidden area on the White House grounds and demanded to meet with President Donald Trump.

The one-time crane operator bounced between states and suffered from delusions, sometimes talking about plans to marry singer Taylor Swift, friends and relatives have told authorities.