This page lists a few 'recipes' that will teach you in a few steps how to do common tasks using Feel

Introduction

Want to get started quickly with Feel? This page contains simple steps you can follow for a number of basic situations, no explanations, just quick steps. Don’t hesitate to check the rest of the documentation to learn more about how the engine works. And if you’re wondering how to achieve something, or would like to see a particular recipe on this page, don’t hesitate to make suggestions!

Note that most of these will provide Feel / Unity versions, that’s just to provide the context they were first written in. But it’s safe to assume that they should work on any higher versions of both Unity and Feel.

How to use MMFeedbacks to trigger a particle system?

  • in Unity 2019.4.26f1, create a new project
  • from the Package Manager, import Feel v2.1
  • create a new scene
  • create a new empty object in it, add a particle system component to it
  • let’s make it a bit prettier, under its Renderer panel, click on the Material dot on the right of the field, and pick the FeelSnakeEatParticleMaterial
  • under its Emission foldout, set RateOverTime to 0, and add a Burst instead by pressing the little “+” under Bursts (default settings will do)
  • towards the top of the inspector, set the StartLifetime to 0.5
  • then check SizeOverLifetime down in the list of foldouts, and set its size curve to any of the default downward curves
  • if you were to play your particle system, you should see a bunch of bubbles shrinking down rapidly
  • now create a new empty object, call it MyTestFeedbacks, add a MMFeedbacks component to it
  • add a ParticlesPlay feedback to it, and drag the particle system you’ve created into its BoundParticleSystem slot
  • press play in your editor, then select your MyTestFeedbacks object, and in its MMFeedbacks inspector, press the green Play button
  • now you know how to trigger particle systems via MMFeedbacks. Note that there are other ways to do it, for example you could decide to make a prefab out of your particle system, and instead use the ParticleInstantiation feedback

How to setup a regular, non-Cinemachine camera shake

  • in Unity 2019.4.26f1, create a new project
  • from the Package Manager, import Feel v2.1
  • create a new empty scene
  • add a cube, position it at 0,0,0
  • create an empty game object at the camera’s position, call it CameraRig
  • create an empty game object at the camera’s position, call it CameraShaker, nest it under CameraRig
  • nest your Camera under CameraShaker (you should have CameraRig > CameraShaker > MainCamera)
  • on your CameraShaker node, add a MMCameraShaker component
  • on its MMWiggle, check Position, select Noise as wiggle type, uncheck wiggle permitted
  • create an empty game object, call it MyTestFeedbacks, add a MMFeedbacks component to it
  • add new feedback > camera > camera shake
  • press play, then Play on your MyTestFeedbacks inspector, camera will shake

How to setup a Cinemachine camera shake

  • in Unity 2019.4.26f1, create a new project
  • from the Package Manager, import Feel v2.1
  • from the Package Manager, import Cinemachine
  • create a new empty scene
  • add a cube, position it at 0,0,0
  • via the Cinemachine menu in the top menu, create a new virtual camera
  • select your virtual camera, and via its AddExtensions dropdown, add an impulse listener
  • create an empty game object, call it MyTestFeedbacks, add a MMFeedbacks component to it, position it at 0,0,0
  • add a new Cinemachine Impulse feedback to it, via its “Add new feedback” dropdown
  • from its inspector, click the little cog at the end of the RawSignal field and select Presets > 6D Shake
  • set its Velocity (at the bottom of the inspector) to 5,5,5
  • press play in the editor, select the MyTestFeedbacks object, and in its MMFeedbacks inspector, press the green Play button
  • CAMERA SHAKE!

How to use Feel with URP?

  • in Unity 2019.4.26f1, create a new project using the URP template
  • from the Package Manager, import Feel v2.1
  • that’s it, you can now use Feel with your URP project

Ok and how to use MMFeedbacks with URP volumes then?

  • after the steps described above :
  • create a new scene
  • in it, add a cube, position it at 0,0,0
  • create a new global volume (right click, volume > global volume in your Hierarchy panel)
  • press the New button next to Profile in its inspector
  • add an override to it, pick Vignette, set the Vignette’s intensity to 0.5
  • add a new component to the global volume, in the add component menu type MMVignetteShaker_URP
  • select the MainCamera, in its inspector under Rendering, check PostProcessing
  • you should now see the Vignette in your Game view
  • create an empty game object, call it MyTestFeedbacks, add a MMFeedbacks component to it
  • press the “add new feedback” dropdown and select PostProcess > Vignette URP
  • in its inspector, set Remap Intensity Zero to 0.5
  • press play in the editor, select the MyTestFeedbacks object, and in its MMFeedbacks inspector, press the green Play button
  • now you know how to trigger volume feedbacks. To target other post processing filters, make sure you add the corresponding Shaker on the Volume

How to setup a camera zoom feedback?

  • in Unity 2019.4.26f1, create a new project
  • from the Package Manager, import Feel v2.1
  • from the Package Manager, import Cinemachine
  • create a new empty scene
  • add a cube, position it at 0,0,0
  • select your MainCamera, add a MMCameraZoom component to it
  • create an empty game object, call it MyTestFeedbacks, add a MMFeedbacks component to it
  • add a Camera > Camera Zoom feedback to it, via its “Add new feedback” dropdown
  • press play in the editor, select the MyTestFeedbacks object, and in its MMFeedbacks inspector, press the green Play button

How to trigger MMFeedbacks via the Timeline

  • in Unity 2019.4.26f1, create a new project
  • from the Package Manager, import Feel v2.1
  • for this example we’ll open the FeelDuck demo scene
  • create a new empty object, call it Director
  • open the Timeline panel (Window > Sequencing > Timeline)
  • in the Timeline panel, press the Create (a director) button, call the new asset TimelineDirector, save it in your project
  • drag the FeelDuckBackground into the Timeline, and pick “Add activation track”
  • copy the Active block, move the new one to the right, you should now have two Active blocks, maybe with a bit of a gap between them, that’s our Timeline animation (it’ll activate/disable/activate the background, of course you may want to do more fancy stuff in your own Timeline, that just gives us a track to play)
  • press the little pin icon under the frame count to reveal our markers track
  • around frame 120, right click in the marker track and select “Add signal emitter”
  • in the inspector, click on Create Signal, name the new asset “TestMMFeedbacks.signal”, save it in your project
  • in the inspector, click on “Add signal receiver”
  • select your Director object, and in its inspector, drag the FeelDuckJumpStartFeedback into the SignalReceiver’s event reaction slot, select its MMFeedbacks > PlayFeedbacks() method as its reaction
  • press play in the editor, then press play in your timeline, your feedback will play everytime the play head passes the marker
  • don’t hesitate to check https://blog.unity.com/technology/how-to-use-timeline-signals to learn more about how Timeline and Signals work

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

  • create a new project in Unity 2019.4.28f1
  • import Feel v2.3
  • 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.

How to setup floating texts to play them via feedbacks?

  • in Unity 2019.4.26f1, create a new project
  • from the Package Manager, import Feel v2.2
  • in an empty scene (or your scene), create a new empty gameobject, name it “FloatingTextSpawner”, add a MMFloatingTextSpawner component to it.
  • in your project panel, search for the MMFloatingText prefab, and drag it into the newly created spawner, under its Pooler settings, in the PooledSimpleMMFloatingText slot
  • create a new empty object, call it “TestFeedbacks”, add a MMFeedbacks component to it
  • add a new UI > Floating Text feedback to it
  • press play, play your feedback, you’ll see a “100” text spawn every time
  • to go further, you can check the “use intensity as value” to have it apply your MMFeedbacks’ intensity to the feedback
  • you can also dynamically change the Value attribute of that MMFeedbackFloatingText component to anything you want
  • you can also use events from anywhere in your code to have the spawner emit new floating texts, using the MMFloatingTextSpawnEvent. You’ll see an example of such an event call in the MMFeedbackFloatingText class, it’s a one line call.

How to add a button to mute all sounds?

  • in Unity 2019.4.26f1, create a new project
  • from the Package Manager, import Feel v2.2
  • in a scene containing a MMSoundManager
  • create a UI button, press “+” on its OnClick action, drag your MMSoundManager in that slot, and select the MuteMaster method
  • press play, pressing the UI button will mute all sounds playing through the MMSoundManager
  • note that you can also do that via a MMFeedback (MMSoundManager Track Control, or MMSoundManager All Sounds Control), and you can also decide to save this setting via a feedback, see http://feel-docs.moremountains.com/mmsoundmanager.html for more info on that!