The Engine I use is Godot, you can achieve this kind of mechanic in any 3d game engine. How this works is it pick points in a sphere, the center of this sphere is the player camera. I am not 100% sure how valve did this, but I think I did a good job remaking this. I know the hitbox just sucks sometimes, but you can't deny how creative this kind of hitbox is.
Hide player controls
Hide resume playing