While Mr. Luckey became a tech icon for reviving interest in virtual reality, his politics burst into view in September when The Daily Beast published an article saying he had quietly funded a pro-Trump nonprofit, Nimble America.

After the article ran, Mr. Luckey said on Facebook that he was sorry his actions were hurting Oculus. He said he had given the nonprofit $10,000 because he believed it had “fresh ideas on how to communicate with young voters through the use of several billboards.” He said news articles, some of which accused him of funding the creation of racist memes, had distorted his views.

Mr. Luckey said in the post that he was a libertarian who intended to support that party’s candidate for president, Gary Johnson.

He was gone from Oculus by March. An Oculus spokeswoman said Mr. Luckey’s departure had not been connected to his political views. But the person who knows Mr. Luckey said he had been pushed out and was rarely seen in the Oculus offices after the news about his political activities broke.

Soon after, he was working on his next start-up idea: The company plans to use a technology found in self-driving cars called lidar — shorthand for light detection and ranging — as well as infrared sensors and cameras to monitor borders for illegal crossings, according to the three people familiar with the plan.

As as he sees it, according to those familiar with the plan, the technology can be used for many kinds of perimeter security, including military bases and stadium events, where it could be used to detect drones. Software would help the system figure out which objects to ignore, like birds and coyotes.

Those familiar with the plan say Mr. Luckey believes his system, which can be mounted on telephone poles, can be built far more cost effectively than Mr. Trump’s proposed wall on the Mexican border — and with fewer obstacles from landowners.