Demo Animation Guide

This guide will go over some of the animation considerations you will need to make when setting up the PNM System for mounting and dismounting.  This guide is targeted at the use of Unreal's Manny and Quinn models and Animation Blueprint that they use.  There are a few tweaks you may want to be aware of if you plan to use these two as a foundation of your characters in your game with the PNM System.

 

References

This guide attempts to walk you through some of the changes to the animation system that will need to be considered if you are using the default Mannequin models and animation blueprints.

If you just want to see what has been changed open up the ABP_MST_Manny Animation Blueprint found in the Mounting System Tutorial (MST) or ABP_AMS_Manny Blueprint found in the Advanced Mounting System (AMS) plugin you should download the Demo Projects.  To Download the Demos see Quick Start Guide

The Key takeaways are 

  1. You need to handle the Unreal Mannequin's foot IK system so the characters legs do not lock up and prevent the animation due to IK system
  2. You need to create a slot to play the animations if you are using montages.

Mounting System Tutorial Core (MSTC)

The MSTC does not have any Animation Systems with it.

Mounting System Tutorial (MST)

ABP_MST_Manny

This is  a customized version of the default Epic mannequin Animation Blueprint (ABP).  While there are a Manny and Quinn Animation Blueprint included the Manny ABP is the parent of the Quinn ABP.  This guide goes over how this ABP was customized.

Advanced Mounting System (AMS)

ABP_AMS_Manny

This is basically a copy of the ABP_MST_Manny but specifically for the AMS System so that it is not relying on the MST for content. 

Handling the Foot IK System

As part of the implementations of the Mounting System Tutorial (MST) and Advanced Mounting System (AMS) demo plugins I created an interface called BPI_MST_Rider and BPI_AMS_Rider to hold special functions for the rider in these implementations.  The blueprint interface has a getter for the Foot IK Flag and a Setter for the Foot IK Flag.

The MST the Foot IK Flag is enabled in the IMountRiderInterface::OnMountingPawnFinished() functions. Since no animations play for the MST this was the easiest place to put this function

The AMS the Foot IK Flag is enabled in the IMountRiderInterface::PlayMountingAnimation() and disabled in the IMountRiderInterface::OnDismountingPawnFinished() functions.  The main reason for the change here is that during the montage to play the animation that mounts the character to the mount the feet need to move and not be locked by the IK System.

You can setup both the MST and AMS to use the PlayMountingAnimation() function for this but the MST came first and that was where it was placed first.  So it is a good point of demonstrating that the PNM System has many ways you can implement your mounting system.

Animation Blueprint

In the Animation Blueprint you can add a few flags to help play animations based on if you are mounted or not.

Variables

In both the MST and the AMS the animation blueprints add two variables.

  • IsMounted - set int he event graph by calling IADMUnifiedControllerPawn::IsMounted()
  • IsFootIkEnabled - set in the event graph by calling the IsFootIKEnabled from the BPI_MST_Rider or BPI_AMS_Rider blueprint interfaces.

AnimGraph - Montage Slot

If you plan on playing montage animations then you need to setup a Slot node on the AnimGraph to play the montages.  For the Demo we simply use the DefaultSlot to play a full body Montage which then gets feed into the Control Rig Node.  This makes the entire montage animation play and overwrites any output that comes from the "Main States" Animation State Machine.

AnimGraph - Control Rig

On the AnimGraph you need to disable to IK system using the Control Rig Node that is already on the graph

For the "Should Do IK Trace" input pin, you want that to happen if you are not falling and not mounted.  

For the "Should Do Foot IK" you simply feed in the IsFootIkEnabled variable you setup.

The IsMounted State

Finally we need to add an IsMounted State to the Locomotion Animation State Machine.  This will simply play any "mounted" animation we need to play.  

Inside the Locomotion State Machine add a new node for IsMounted.

Connect transition arrows to and from the Idle and the Walk/Run State

For Transitions to the IsMounted State simply use the IsMounted variable we created.

For Transitions out of the IsMounted State simply use a Not Boolean node with the IsMounted varable.

Conclusion

This concludes the changes that have been made to the Animaiton Blueprint in the AMS and the MST demo projects.  This is simply an example of how you can setup your mounting animations.

Next Section: Demo Seat Setup