Setting up the Shooter Motion Pack to work with your character is really the same as other motion packs. The steps are pretty simple:
- Import the Shooter Motion Pack into an existing Motion Controller project
- Download Mixamo’s free Pro Rifle Animations and place them in the project
- Unzip the custom Pro Rifle Animation meta files I provide
- Use the Motion Controller’s Packs tab to setup your character
We’ll walk through each of those steps below…
1. Import the Shooter Motion Pack
- Open Unity 5.5.0f3 or higher
- Open your existing Motion Controller project or start a new project
- Download and import the latest Motion Controller per the User’s Guide
- Download and import the latest Shooter Motion Pack
While the MC User’s Guide is long, the first couple of pages are all you need to get started.
2. Mixamo’s Free Animation
While you can actually use any animations with the Motion Controller and Shooter Motion Pack, Mixamo allows us to download and use their animations for free. However, we have to get them from Mixamo.
Simply follow these steps:
- Log into Mixamo.com
- Click the Characters link at the top left of the page
- Find and click on the ‘Y Bot’ character to make him active
- Click the Animations link at the top left of the page
- Search for and click on the ‘Pro Rifle Pack’ animation pack
- Click the ‘Download’ button at the top right of the page
- Select the following options:
Format: FBX for Unity (.fbx) Pose: T-pose Frames per Second: 30 Keyframe Reduction: none
- Click the ‘Download’ button
- Save the .zip file locally
The .zip file will contain about 50 files. Most of these will be simple animations, but there will be a ‘ybot.fbx’ that is the physical character and avatar.
Keep this file for future use.
3. Unzip Animations and Meta Files
At this point, we can unzip all the animations we just downloaded into the motion pack’s animation folder. My setup code expects this folder.
However, we don’t want Unity to create its own meta files for these animations. Instead, we’ll use the ones that I’ve modified for you.
Meta files store changes to animations and animation events. So, it’s important that you use my .meta files.
Unzip the contents of the AnimationMeta.zip file from here:
To the same folder you put Mixamo’s animations:
Unity will import my .meta files instead of creating new ones. You’ll see a mix of .meta files and .anim files in the .zip. Just unzip them all.
It’s best to close Unity and re-open it. Sometimes it needs to do this to recognize the animations.
4. Setup Character
With the animations downloaded and my .meta files imported, we’re ready to setup the motions on our character.
I suggest starting with my demo scene. You can find that here:
Simply open the scene with the Motion Controller character and click on the character in the Unity hierarchy. In the case of the demo, it’s the ‘Player’ object.
In the character’s inspector, scroll down until you find the Motion Controller character and press the “Setup Input Entries” button if you see it.
Now, press the ‘Packs’ button.
This will open the Packs view of the Motion Controller and allow you to choose the setup options.
Simply choose the ‘Shooter’ entry from the Motion Packs list.
If this is your first time setting up the character, leave everything checked and press ‘Setup Pack’.
Your character is now setup with the shooter motions, inventory entries and everything you need to get running.
I’ve included a simple demo scene:
Open the scene and do the following:
- Select the ‘Player’ character in the hierarchy
- Press “Setup Input Entries” (if it exists) on the character’s Motion Controller
- Press the “Packs” button to go to the packs view
- Select the “Shooter” motion pack in the list
- Check all the options and press the “Setup Pack” button
- Press Unity’s play button
Once playing, press ‘4’ on the keyboard. This is the default weapon set number for the rifle. The character will equip it and you can begin shooting things.
WASD = Move RMB = Aim LMB = Fire 4 = Equip/Store Rifle 5 = Equip/Store Pistol m = Toggle Cover r = Reload f = Throw Grenade