Hi all,
I've put together some code to create a cover and camera system similar to gears of war for people to use. It works by firing a series of traces to determine if the pawn is fully behind cover, partially behind cover, whether they need to crouch and what angle they need to rotate to put their back flat against the cover. It also contains a Gears of War style reloading system, with timed reloads and damage boosts for getting the timing right.
Video:
Features:
- Full cover system. Player will crouch automatically behind low cover, stack left or right when they reach an edge and can pop in and out to fire
- Player sprinting
- Walking, aiming, stacking and sprinting camera
- Very simple AI which will stand and shoot at the player when they're in sight (to be expanded upon!)
- An ugly, clunky HUD for displaying ammo and the reload process in a similar way to Gears of War (replace with your own, less ugly version)
Missing Features / Known Issues:
- Vaulting not supported yet. I want to do this with root motion.
- Similarly, running out from cover is not supported
- Switching from cover to cover not supported yet
- Cover system sometimes gets confused with curved convex surfaces, will tighten up the tracing to handle it better
- The pawn currently teleports in and out of cover when aiming from the stacking state. Would like to use root motion for nice smooth animation.
Anyway, I thought I'd release what I've got so far in case someone finds it useful, otherwise watch this space for updates! As always, feel free to rip the code apart and do what you want with it.
Download link here:
https://dl.dropboxusercontent.com/u/...r_20140119.zip
Hope someone finds this useful, and please pass on any feedback or bugs you find
I've put together some code to create a cover and camera system similar to gears of war for people to use. It works by firing a series of traces to determine if the pawn is fully behind cover, partially behind cover, whether they need to crouch and what angle they need to rotate to put their back flat against the cover. It also contains a Gears of War style reloading system, with timed reloads and damage boosts for getting the timing right.
Video:
Features:
- Full cover system. Player will crouch automatically behind low cover, stack left or right when they reach an edge and can pop in and out to fire
- Player sprinting
- Walking, aiming, stacking and sprinting camera
- Very simple AI which will stand and shoot at the player when they're in sight (to be expanded upon!)
- An ugly, clunky HUD for displaying ammo and the reload process in a similar way to Gears of War (replace with your own, less ugly version)
Missing Features / Known Issues:
- Vaulting not supported yet. I want to do this with root motion.
- Similarly, running out from cover is not supported
- Switching from cover to cover not supported yet
- Cover system sometimes gets confused with curved convex surfaces, will tighten up the tracing to handle it better
- The pawn currently teleports in and out of cover when aiming from the stacking state. Would like to use root motion for nice smooth animation.
Anyway, I thought I'd release what I've got so far in case someone finds it useful, otherwise watch this space for updates! As always, feel free to rip the code apart and do what you want with it.
Download link here:
https://dl.dropboxusercontent.com/u/...r_20140119.zip
Hope someone finds this useful, and please pass on any feedback or bugs you find

Comment