Adding Shooting To My Endless Runner

I’m just putting the finishing touches on my endless runner. I now have shooting animations linked up.


I have a separate GameObject for the body and the legs. When the player shoots, I simply tell the top animation to switch from shooting or to running. The legs stay the same. After that I simply spawn new bullets every time I detect the fire button was pressed.


Here you can see I didn’t set up the logic to destroy the bullets which looks kinds of funny. Without that final piece of logic, the simply collect on any other GameObject with a solid collider.

Finally, I have all the logic in place and I added a little recoil which pushed the player backwards every time they shoot.


This subtle touch adds a little bit of balance to the game. It forces the player to decide if they want to shoot their guns they are going to get pushed closer towards the mob of zombies on the far side of the screen. So now shooting the gun becomes a last ditch effort, while the main focus is to simply try to jump over obsticals.

Subscribe To My Mailing List

Want to learn how to make a game? Not sure where to start? Even if you are a seasoned game maker there is still a lot you can learn from my mailing list. I'll be covering tips and tricks for how to build, release and market games each month.

Simply sign up for my mailing list and also get access to a 50% off discount code for my eBooks and other content. I promise to not spam your inbox!

Join Now