๐Ÿงพ
FPS Animation Framework
  • ๐Ÿ‘‹Welcome!
  • Workflow
    • ๐ŸฆพCharacter Rig
    • ๐Ÿ”ŒComponents
    • ๐Ÿ”ธProfiles and Layers
    • ๐Ÿ”—Linking
    • โž•Integration
    • โ–ถ๏ธPlaying Animations
    • ๐Ÿ’ปExtending the System
  • Demo Project
    • โœจResources
    • ๐ŸŽฎController
    • ๐Ÿ”ซWeapons and Items
    • โž•Attachment System
  • Fundamentals
    • ๐ŸฆพRig
    • โš™๏ธFramework Architecture
    • ๐Ÿ“‘Animator Profiles
    • ๐Ÿ“œAnimator Layer
    • ๐ŸŽฎInput System
    • ๐Ÿ”ถAnimator Layers
      • Weapon Layer General
      • Additive Layer
      • Ads Layer
      • Attach Hand Layer
      • Collision Layer
      • IK Layer
      • IK Motion Layer
      • Look Layer
      • Pose Offset Layer
      • Pose Sampler Layer
      • Sway Layer
      • View Layer
      • Blending Layer
      • Turn Layer
    • ๐Ÿ“šNew Animation Library
    • โš’๏ธTools
  • Recoil System
    • ๐Ÿ”ซRecoil Animation
    • ใ€ฝ๏ธRecoil Pattern
    • ๐Ÿ“นCamera Shake
  • Troubleshooting
    • โš ๏ธInitialization Warnings
    • โš ๏ธCan't Look Around
    • โš ๏ธWeapon Positioning
    • โš ๏ธWeapon is not moving
  • โš ๏ธAiming doesn't work
  • โš ๏ธTwisted feet when looking left/right
  • ๐ŸŒŒMisc
    • ๐Ÿ“œChangelog
      • 4.7.0 Update
Powered by GitBook
On this page
  • Overview
  • FPS Animator
  • FPS Bone Controller
  • User Input Controller
  • Playables Controller
  • Execution order
  1. Workflow

Components

In this section we will learn about the core components.

PreviousCharacter RigNextProfiles and Layers

Last updated 5 months ago

Overview

After the previous step, these components had been added to our character:

FPS Animator

It is a central hub component, which controls the flow of all entities in the framework, by initializing, updating, and disposing of other components.

FPS Bone Controller

This component applies procedural animation features. It does not have any special properties, hence there is no special setup for this component.

User Input Controller

The FPS Animation Framework introduces a standalone input property system. The idea is that you can define custom properties in the Input Config asset and use them in runtime:

This system is used to establish communication between the framework entities and your project codebase.

Example: let's say you want to disable aiming when jumping. You can create a new float parameter, set it to 1 or 0 in code based on the jumping condition, and then specify that parameter as a control value in the Ads Layer.

User Input Controller allows you to work with the property system, by getting or setting the values:

Tip: the User Input Component inspector has a really neat feature - it displays all the properties in play mode, and you can even modify them.

Playables Controller

Create a new Avatar mask, select the upper body bones, and assign it to this component:

Your upper body mask needs to be adjusted to play custom animations. To do this, go to Window/FPS ANIMATOR/Tools/Avatar Mask Modifier. Now we need to add the WeaponBone object to the avatar mask. Specify the Root and the Upper Body Mask:

Tip: the WeaponBone will be used later in the animation workflow, essentially it contains the weapon movement.

The Playables Weight Property is used to control the influence of the Playbles Controller. You can specify here any float value from the input system, but it is recommended to leave the PlayablesWeight as a default value.

You can also use this component to preview animations in the editor. Just select your animations and hit the preview button!

Execution order

Lastly, we need to adjust the Script Execution Order in the Project Settings. Go to the Edit/Project Settings/Script Execution Order and make sure to put the FPS Animator after your controller class:

Tip: this step is required for the proper input update process, so the FPS Animator can use the latest user data to avoid lagging.

It is also important to initialize the FPS Animator component in the controller. This can be done by calling the Initialize() method:

ExampleController.cs
private void Start()
{
    _fpsAnimator = GetComponent<FPSAnimator>();
    _fpsAnimator.Initialize();
}

At this point, the character setup is complete. In the next section, we will learn about the procedural animation assets.

This component controls how Animation Clips are played in runtime. It uses to add custom animation layers, that allow you to play animations right from code.

๐Ÿ”Œ
Unity Playables API
Components.
This asset contains your custom properties.
Specify the input asset.
Playables Controller inspector.
Press the Add Bone button.
FPSController can be your controller class, where you use the FPS Animator component.