This page explains what MMTools are and how to use them

What’s MMTools?

MMTools is a collection of helpers and systems used by most, if not all, MoreMountains assets.

They’re included in Feel, and you’re free to use them in any project you want. Don’t hesitate to explore and experiment with them, they’re all commented and documented in details in the API documentation.

While more documentation on MMTools is still on its way, this video should give you a first tour of some of its contents :

MMTools Recipes

How to make an object wiggle in your scene?

  • in Unity 2019.4.28f1, create a new project
  • from the Package Manager, import Feel v3.0
  • in a new scene, create a cube
  • add a MMWiggle component to it
  • check the Position checkbox, set its Wiggle Type to Noise, press play, you now have a wiggling cube
  • you can now increase the frequency, amplitude, or add a shift (useful if you have more than one of these), and play with all the other options

How to use the MMHealthBar component to automatically draw health bars?

  • create a new project in Unity 2019.4.28f1
  • import Feel v3.0
  • create a new, empty scene
  • create a cube, position it at 0,0,0
  • add a MMHealthBar component to it
  • press play, you’ll notice the healthbar gets drawn above your cube
  • if you now want to interact with your MMHealthBar and update it, you’ll need to pass it data to update it. We’ll use a script to do so.
  • create a new C# class, call it TestMMHealthBar, and paste the following in it :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MoreMountains.Tools;

/// <summary>
/// A simple class used to interact with a MMHealthBar component and test it
/// To use it, add it to an object with a MMHealthBar, and at runtime, move its CurrentHealth slider, and press the Test button to update the bar
/// </summary>
public class TestMMHealthBar : MonoBehaviour
    [Range(0f, 100f)]
    public float CurrentHealth = 50f;

    protected float _minimumHealth = 0f;
    protected float _maximumHealth = 100f;
    protected MMHealthBar _targetHealthBar;

    [MMInspectorButton("Test")] public bool TestButton;

    protected virtual void Awake()
        _targetHealthBar = this.gameObject.GetComponent<MMHealthBar>();

    public virtual void Test()
        if (_targetHealthBar != null)
            _targetHealthBar.UpdateBar(CurrentHealth, _minimumHealth, _maximumHealth, true);    
  • add this component to your Cube, press play, and at runtime, move its CurrentHealth slider in its inspector. Every time you press the Test button, the health bar will update.

Setting up a MMBlink component

The MMBlink component will let you define blinking sequences on objects, and you can then use a MMBlink MMFeedback to trigger it. Here’s one way to set it up :

  • in Unity 2019.4.29f1, create a new project using the standard RP
  • from the Package Manager, import Feel v2.4.1
  • in a new scene, create a new sprite renderer, set its sprite to “button-A” (or any sprite of your choice)
  • add a MMBlink component to it, set its Method to Material Alpha, and drag the Sprite Renderer into the MMBlink’s TargetRenderer slot
  • then we’ll want to define our blink sequence, set the Phases array’s size to 2
  • under the array’s Element 0, set PhaseDuration to 1, OffDuration to 0.3, OnDuration to 0.7
  • under the array’s Element 1, set PhaseDuration to 0.5, OffDuration to 0.2, OnDuration to 0.3
  • set the Repeat Count to -1 (which will have it repeat forever)
  • press play, the sprite will now blink in repeating patterns

Now to have a MMFeedbacks trigger it :

  • uncheck Blinking on the MMFeedbacks, and set the RepeatCount to 5
  • create a new empty game object, call it MyTestFeedbacks
  • add a new feedback (renderer > MMBlink), and drag the MMBlink object into its TargetBlink slot
  • press play in your editor, then press Play on the MyTestFeedbacks’ inspector’s test button, the sprite will blink for 5 sequences

The MMBlink component offers quite a few options, letting you blink objects by enabling/disabling objects, playing on their alpha, emission, or simply any float on their material’s shader. You can also have it lerp these values (change the Element0 and Element1’s On/Off Lerp Durations to 0.5 to test that)