Henry Orenstein, a Holocaust survivor who went on to invent the Transformers toys and became a major donor to Jewish and Israeli causes, died December 14 at the age of 98.

Orenstein became a best-selling toy maker with his Transformers line, which he first created in the early 1980s. He followed up on that success with numerous other inventions and over 100 patents before eventually becoming a star poker player and being inducted into the Poker Hall of Fame in 2008.

Born in Poland to a Jewish family in 1923, Orenstein managed to survive the war due to a gamble he made in 1944, the first of several that would shape his life.

While imprisoned at Budzyn, a German labor camp in Poland, in 1944, the Nazis running the camp ordered all scientists and mathematicians to register with the camp administration. Despite not knowing if the scientists and mathematicians would be given better conditions or killed immediately, and despite the fact that Orenstein himself was neither a scientist or mathematician, he signed himself up along with his brothers who were interned there with him.

That decision may have been the difference between life and death for Orenstein.

“At that time, we’d heard that days before they killed off all 17,000 Jewish inmates in Majdanek, so I thought our turn is coming,” Orenstein told the Jewish Telegraphic Agency in 2005, referring to one of the main Nazi death camps in Poland. “And to play for time, I registered myself and my three brothers as scientists and mathematicians, even though we were not. Just gambling for time. It turned out to be a good gamble.”

The Nazis were organizing a special unit of prisoners to develop a weapon to help the Nazis win the war and the prisoners assigned to the unit were spared execution. Luckily for Orenstein, who was only 16 when the war broke out, the math problems he was required to solve were simple and he, along with two of the three brothers with him, survived the war. His parents, a sister and one brother were killed.

After the war, Orenstein came to the United States and found work in a factory. In the 1950s, he founded a toy company and had his first major success in 1958 when he introduced Betty the Beautiful Bride. But after defaulting on a loan in the 1970s, his company went bankrupt and Orenstein began pitching his ideas to other toy companies.

In 1983, he got the idea for the Transformers — action figures that turn from cars into robots. He brought the idea to Hasbro, which first produced the toys in 1984. The toys would become one of the most successful action figures in history, spawning TV shows, movies and merchandise worth billions of dollars.

In the 1990s, Orenstein turned his inventor’s mind to poker, a game he first started playing in the 1960s. Orenstein was attracted to the game for the way it hinged on calling bluffs and weighing odds.

“Poker is a very fascinating game. You have many elements that go into making a good poker player,” he told JTA in 2005. “You have to be able to calculate odds, you have to read other players’ faces and movements to see whether you can get what they call ‘tells’ — that tell you what kind of a hand they have — and also you have to have a good memory to remember cards.”

In 1996, he patented a new model of poker table with cameras built in that could show television viewers each of the players’ hands throughout the game. That invention, which eventually transformed the experience of watching a poker game from a tedious one to an exciting event, would spark an explosion of interest in the game.

Already a millionaire by the early 1960s, Orenstein was a longtime donor to Jewish causes, including the Metropolitan Council on Jewish Poverty in New York and the Orenstein Project, an Israeli nonprofit he founded in 2017 that focused on food insecurity with special attention to Holocaust survivors.

Orenstein is survived by his wife, Susie Orenstein.