top of page

Cover system

Cover systems have been a staple mechanic of most modern stealth games. The ability to press the character up against a surface, obscures the player from the enemy line of sight. This is usually coupled with a shift in camera angle when approaching a corner to reveal more of the environment, without exposing the player. Cover systems have been around for a long time, but Metal gear solid is the title that really popularized the hiding behind cover mechanic back in 1998. Variations of this feature are recognizable in numerous other titles.

Corner camera offset

To create this mechanic I have made use of sphere and line traces to determine the player position on the desired surface. First a capsule component overlaps with the terrain to check if the player is close enough to the surface. Then A trace is then fired to record the location of the wall normal and a "move to" component, coupled with rotation of the character itself moves the character to place its back on the wall.

Other line traces are linked to the controller right movement, when the player moves right on the wall a trace is fired to its surface by the right shoulder and vice versa with the left hand side. When one of the traces doesn't register a hit, we can determine which side the player has reached a corner on. We can then stop the player movement in that direction and call a function to offset the camera on either side

Progress Video


Recent Posts
Archive
bottom of page