The Stupefy spell is well-known among wizards and witches in Harry Potter's world, because it is one of the most efficient methods to dispatch an opponent in a battle. The ability to knock out any target is also an excellent method to end a conflict without using deadly force.
The spell is used in Hogwarts Legacy in conjunction with another well-known spell called Protego, which is a charm that protects thecaster from spells and physical assaults.
In Hogwarts Legacy, you can cast the Stupefy spell.
The Stupefy spell isn't a standard spell that can be cast by players in the game. Instead, it is used as a counter-spell after a regular Protego cast successfully blocks an enemy spell or physical attack.
Before the strike reaches, the player character alerts the user of an imminent assault with a glowing indicator that lights around their head. The player can then press the appropriate button to cast the Protego spell, which will prevent damage.
If a player holds down that same button for a few extra seconds, they will cast Stupefy to an aggressor, which stun-locks them for a few seconds. In that time, players are able to launch a quick counter-attack or create some space between them and the opponent. It's one of the first spells that new users will learn near the beginning of the game.