How do games implement a stun?

Anyone know what systems games use for stuns? like, how they start, end, and stun the character. Thanks, all help would be appreciated.

1 Like

Playing mobas like Dota have tons of stuns that just make the player unable to move and play an animation. Is that the kind of stun you want? I think the coolest part about its stuns are its signature representations of effects. Stuns have a little swirl effect above the player to tell everyone that the character was stunned. It used to be more visible though lmao

i meant roblox games in perticular, should have pointed that out, and i also meant the logic behind it, not the script but like… how it works i suppose. I’m getting various errors in my game due to my stun system and i’m not sure how i’m supposed to handle it.

Oh okay I think the main steps for a stun is

  • you get stunned

Main thing that happens here is the inability to move your character


  • tell player(s) that you are stunned

I think this is an important step for most games, but you can handle it however. Id probably add something similar to the Dota example with the Swirl above the character.


  • you are no longer stunned

Regain the ability to move here


This is kinda what im thinking about when it comes to stun logic but this might not be what your looking for. I hope that was good.

In my game, you have a flashbang, which blinds a player by making the screen go completely white which includes a ringing noise that overpowers any other sounds, and they both slowly fade back to normal, while a lighting blur effect slowly become less blurry to make it have the effect that they were stunned.
In practice, this often disorients a player, since they can’t see where they are going and can’t hear anything going on around them