The Sentry Gun (sometimes known as a "Sentry" or "Turret") is a building that can be constructed by an Engineer and functions as an automated turret which fires upon any enemy who walks into its line of sight. The Sentry Gun will always target and fire on the closest enemy player or building, provided they are within firing range and in line of sight of the Sentry Gun (not behind a wall, etc).
The Sentry Gun costs 130 Metal to build, 200 Metal to upgrade to level two, and an additional 200 to upgrade to the third and final level. With each upgrade level the Sentry Gun becomes more powerful, gaining machine guns, rockets and the ability to take more damage. The firing range remains constant regardless of level.
The Sentry Gun's ammo may be replenished with your own metal by hitting it with your Wrench. Each bullet reloaded costs 1 metal and each rocket reloaded costs 2 metal.
When placing a Sentry Gun, the limit of its range is represented by a 3D sphere of your team color. A Sentry Gun that is being constructed will have its health increase gradually until it reaches its maximum health upon completion. The Sentry Gun rotates 90 degrees to patrol the area, but is capable of rotating 360 degrees to lock on to a target. This takes a brief moment however, which may allow faster foes to slip past its range. The Sentry Gun can also be manually rotated to face a different direction before you build it: When the blueprint is shown, using the alternate fire button (default key: L trigger) will rotate the blueprints counter-clockwise by 90 degrees.
Sentry Guns will not fire upon enemy Spies that are cloaked or disguised. Sentry Guns will also not fire upon enemies in its range if the enemy is behind cover - this cover includes the Engineer's Dispenser. Sentry Guns are also unable to fire if an enemy Spy attaches an Electro Sapper to it or while they are being upgraded/built. A destroyed Sentry Gun leaves 60 Metal worth of pieces, which can also be picked up by other classes as Ammo. Unlike most other weapons, the Sentry Gun's weapons do not get affected with damage falloff from range nor can it gain criticals.