Skip to main content
‹ Back to Tutorials
Intermediate Unity

Unity 3D + Playmaker - EASY Mech First Person Shooter

Feb 16, 2022
About this tutorial

In this mini Unity 3D Playmaker tutorial part 1, I'll show how to set up a Mech First Person Shooter. I'll set up the player looking around, as well as setting up mech arm animations! Files - Mech Arm and Projectile Prefabs: https://bit.ly/3rRZ6cU (to Join my discord server add a comment and I'll

Written Guide

This first part of a mini mech shooter series sets up a first person view with two animated gun arms in Unity using Playmaker. The scene already includes terrain, a few military vehicles, and a player capsule with the camera inside it. Each gun arm holds a barrel model, a short burst particle system named blast, and an empty spawn point for projectiles. The goal here is to get the player looking around with the mouse and to fire the two arms in alternation.

Understanding the Arm Setup

The blast particle system is configured as a quick burst: rate over time is 0, the count is 10, particles do not travel, and they last only 0.1 second, producing a brief muzzle flash. The spawn point is just an empty game object that will later emit a projectile. With this art already in place, the work is mostly wiring up input and animation.

Adding Mouse Look

Rather than build aiming from scratch, use a Playmaker template. Open Playmaker, go to Add-ons, then Ecosystem, and open the Ecosystem Browser. Filter to Templates, click Browse, and find First Person Look, installing it with Get if you do not already have it. Select the player, add a Playmaker FSM component, and in the Playmaker editor use the template menu (the small icon) to apply First Person Look. The one remaining step is assigning the camera as the player camera. Now moving the cursor rotates the camera and the arm follows along.

Animating the Gun Arm

With an arm selected, open the Animation window and create a new clip in the animations folder under a mech shooter folder, naming it gun idle. While recording, turn the blast off so the idle state has it deactivated, and nudge the barrel's position slightly to record a keyframe across all three axes. Create a second clip named gun fire, drop the frame rate to 12 frames per second, and record: toggle the blast on at the start, then off around frame six for a short flash. Move the barrel back one frame in, then copy the opening keyframe to frame six so the barrel recoils and returns. Importantly, select the gun fire clip and turn off Loop Time so it plays once. Finally, duplicate the arm, rename it arm two, and move it into place so there are two guns.

Firing the Arms in Alternation

Add an empty game object named gun fire and give it an FSM whose first state, listen for input, uses a Get Mouse Button Down action on the left button sending a fire gun event. That transitions to a fire arm one state with an Animator Play targeting arm one and playing the gun fire state by name, followed by a Wait of 0.2 seconds to prevent rapid spamming, then a next event. Copy this whole state so the second listening state instead routes to fire arm two, which plays arm two's gun fire animation before returning to listen for input, alternating between the guns. A first test shows the clips only play once, so in the Animator add a transition from gun fire back to idle. After that, each mouse click reliably fires one of the two arms.

Unity tools by Bliz Studio
Built for our own games — now on the Asset Store

Multi Tag — unlimited hierarchical tags for any GameObject. Hierarchy Pro — style your whole hierarchy with rules. Made by a Unity dev, for Unity devs.

Explore our Unity assets →