Quick answer: Antivirus flags your game almost always as a false positive: it's flagged or blocked as a potential threat because it's unsigned (no code-signing certificate), has low reputation (a new, uncommon executable few people have run safely yet), or uses packers/obfuscation or behaviors that trigger antivirus heuristics. It's not actually malware, antivirus is reacting to trust signals, which you can address by code-signing and building reputation.
Having your game flagged by antivirus, or blocked by Windows SmartScreen, is alarming and damaging: players see a security warning and may not run it. It's nearly always a false positive, triggered by signals antivirus uses to assess unknown software, and removing those signals is the fix.
Why Antivirus Flags Legitimate Games
Antivirus and OS protections (like SmartScreen) assess unknown executables for risk using several signals, and a legitimate game can trip them. Unsigned executables: a build without a valid code-signing certificate is inherently less trusted (a major cause of warnings). Low reputation: reputation systems trust software many users run safely; a new or uncommon executable (like an indie game few people have run) has low reputation and gets flagged until it builds trust. Heuristic triggers: certain behaviors or characteristics, packers/obfuscation (often used by malware) or behaviors resembling malware, cause false positives.
So a flagged game is usually a false positive driven by being unsigned, new/uncommon, or using something that resembles malware to a heuristic, not because it's malicious.
How to Diagnose and Fix It
Note what's flagging it (a specific antivirus, or SmartScreen) and whether it's a block or warning. Check whether your build is code-signed (a prime cause), whether it's a new/low-reputation executable (likely if new), and whether you use packers/obfuscation. Player reports of antivirus warnings or SmartScreen blocks, concentrated around launch (when the executable is newest), are the signal. This is a distribution/trust issue, not a runtime bug.
Fix by code-signing your builds (the most important fix, as signed software is far more trusted and signing resolves many flags), building reputation over time, avoiding heuristic-triggering packers, and reporting false positives to antivirus vendors. See our guide on fixing a game flagged by antivirus.
Antivirus flagging your game is almost always a false positive from being unsigned, new, or heuristic-triggering. Code-sign your builds (the key fix), build reputation, and report false positives.