• Register
Post tutorial Report RSS How I badly designed Kicking

How I stupidly put together a kick mechanic for First Person Stapler.

Posted by on - Basic Design/Concepts


I love reading about the stupid, but functional work-arounds developers use when they need something to look right, but they don't have time to do it right, like the wind-balls in Uncharted 4 or the subway helmet from Fallout 3. So, I thought I'd write up some of the stupid things I've made myself.

I knew pretty early on in First Person Stapler that I wanted the player to be able to kick as one of their primary functions. It’s how I stupidly solved the door problem, which I’ll explain later, and at the time, I wanted much more of the game to be kinetic. Either way, I had never done kicking before, or even punching.

So, instead of reading about fighting games or downloading something sane from the Unity asset store, I repurposed the firing mechanic from the stapler and made giant, leg-shaped bullets. There is a modified version of the bullet spawn point down to about where the player's thigh should be on the prefab. Now every time the player kicks, they spawned a brand new leg just for the purpose of that kick.

biblicly accurate player legs


It worked pretty well, but it got slightly disturbing when the player's leg didn't hit an obstacle and just endlessly flew off into the distance. To solve that problem, I created a script that reversed the leg velocity and sent it back to its socket right before it winked out of existence, which looked good when the player was at a standstill, but this game isn't about being at a standstill. Every time the player kicked while running, which was always, the leg would faithfully return to its spawn point after lashing out a few feet, only to find the rest of the player halfway across the room.

I wasted a few more hours making the script more and more complex, trying to get the leg-bullet to return safely back to the player after it’s very short firing, and eventually just stopped. I realized the kick mechanic was less than a second long. Having the leg return to the original position sounds logical, but in an animation cycle that short, it might be unnoticeable.

Responsible leg clean up


So, I made the leg just destroy itself when it hits something or gets too far from the player. It’s lazy, but it saved me an enormous amount of time that I could have spent polishing a fraction of a second on a secondary mechanic. And, since very few people are used to their legs flying off into oblivion or ceasing to exist after they throw a kick, it makes easy sense to the brain when the leg just isn't in sight anymore.

It's stupid, but it works.

If you want to see the bullet legs in action, check out First Person Stapler on Steam, or check out the demo on Itch.

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: