📗
FPS Animation Framework Legacy
  • 👋Welcome!
  • ⭐Introduction
  • Tutorial
    • 🌟Getting started
      • 🏃‍♂️Character setup
      • 📷Camera setup
      • 🔶Layers setup
      • 🔷Controller setup
      • 🔫Weapon setup
    • 💻Integration
      • 🏃‍♂️Character
      • 🔫Weapon
      • 🔸Layers and animator
    • 🔥Animation Workflow
      • 🦿IK Rig
      • 🔧Character Animation
      • 🔧Weapon Animation
    • ❗Troubleshooting
      • ❔Issue with IK, Left Hand, ADS
      • ❔Broken Character Pose
      • ❔Spinning Character
      • ❔Left Hand IK Always Active
      • ❔Left Hand IK Error
      • ❔Transform NaN Error
  • Fundamentals
    • 🦾Animation System
      • 🔹Playables Sub-System
      • 🔹Curve-blending
      • 🔸AnimSequence
      • 🔸Weapon Bone
      • 🔸IK Animation System
      • 🔸Weapon Anim Asset
    • 🔶Animation Layers
      • Ads Layer
      • Left Hand IK Layer
      • Right Hand IK Layer
      • Locomotion Layer
      • Look Layer
      • Recoil Layer
      • Sway Layer
      • Leg IK
      • Weapon Collision
      • Slot Layer
      • Pose Blending
  • Tools
    • 🟢Validator Tool
Powered by GitBook
On this page
  1. Tutorial
  2. Integration

Weapon

In this section you will learn how to implement FPSAnimWeapon

Step 1 - Add FPSAnimWeapon

Similarly to the character, your weapon class also needs to be derived from a special animation abstract class - FPSAnimWeapon.

YourWeapon.cs
public class YourWeapon : FPSAnimWeapon //<- inherit from FPSAnimWeapon
{
}

The only change you need to make is to override the GetAimPoint() method:

Weapon.cs
public override Transform GetAimPoint() //<- override this in your Weapon class
{
    _scopeIndex++;
    _scopeIndex = _scopeIndex > scopes.Count - 1 ? 0 : _scopeIndex;
    return scopes[_scopeIndex];
}    

In this code we iterate over all scope transforms when player changes a scope.

PreviousCharacterNextLayers and animator

Last updated 1 year ago

💻
🔫