Model Switch

The character controller is able to switch between character models at runtime using the Model Manager component. This component is automatically added to the character when multiple models are specified within the Character Manager. In the demo scene the character can switch between two models:

The list of possible models that the character can switch to is listed within the Available Models list. The currently active model is shown with the Active Model field. Models can be switched by setting the Active Model field:

public void SwitchModels(int index)
{
   var modelManager = m_Character.GetComponent<Opsive.UltimateCharacterController.Character.ModelManager>();
   if (modelManager == null) {
      return;
   }

   if (index < 0 || index >= modelManager.AvailableModels.Length) {
      return;
   }

   modelManager.ActiveModel = modelManager.AvailableModels[index];
}