On the boulevard in front of the presidential palace in Taipei this weekend, Taiwan’s worst nightmare was unfolding in front of film crews. A crowd of actors and extras portrayed one kind of chaos that might come with a Chinese invasion: a protest descending into violence and bloodshed.

The scene being shot was for “Zero Day,” a new Taiwanese television drama series that depicts an effort by China to take over the democratically governed island. Beijing has long claimed Taiwan as its territory and urged it to peacefully accept China’s sovereignty. The Chinese leader, Xi Jinping, has said he would not rule out using force to absorb it.

“Zero Day” will not air until next year, but it has already set off heated debates in Taiwan, after the release of a trailer. Supporters of the series say it could encourage a much-needed conversation about the threat that China poses. Critics have denounced it as scaremongering.

Cheng Hsin-mei, the producer of “Zero Day,” said she wanted to jolt Taiwanese people out of what she sees as widespread complacency and reticence about the possibility of war.

“How everyone would really face up to a war, how you would confront that possibility — nobody’s actually talking about that,” Ms. Cheng, who is also a main scriptwriter for the series, said in an interview. “I want to talk about it, because I think it’s the biggest fear in each Taiwanese person’s heart.”