Engine
Engine copied to clipboard
Bug: CBasePlayer::GetButtons doesn't return ATTACK/ATTACK2 when mouse is moving
If you write a script that keeps track of the player's inputs (through GetPlayer().GetButtons()), you can normally detect when they use the ATTACK and ATTACK2 inputs (blue and orange portal shots, respectively) even when other inputs are pressed (such as walking, strafing, interacting, etc.). However, the input stops being detected when the player's mouse is moving.
This only applies to ATTACK and ATTACK2: other inputs all register correctly while the player's mouse is moving.
In the video, pay attention to the top-left corner. It's printing the current GetButtons() result every tick.
https://github.com/user-attachments/assets/4502286c-11e8-45f5-8119-7d5d6a656af8