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 install Feel in your project?

To add Feel to your project, simply follow the simple steps below :

  1. using 2019.4.13f (or a recent version of Unity of your choice), create a new project, pick the “3D” template
  2. via the asset store panel, go to the Feel page, click the download button, then the import button
  3. wait until a “import Unity package” popup appears, make sure everything is checked (it should be by default), click “import”
  4. open Unity’s Package Manager, install the latest version of the Post Processing package
  5. in the package manager, install the latest version of the Cinemachine package
  6. in the package manager, install the latest version of the TextMesh Pro package
  7. in the package manager, install the latest version of the Animation 2D package (this is only useful for the Letters demo)
  8. open the MMFeedbacksDemo scene (or any other demo), press play, enjoy

How to use MMFeedbacks to trigger a particle system?

  • in Unity 2019.4.26f1, create a new project
  • from the Package Manager, import Feel v3.0
  • 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 Cinemachine camera shake (the recommended way to do camera shake)

  • in Unity 2019.4.26f1, create a new project
  • from the Package Manager, import Feel v3.0
  • 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 (if the cog icon doesn’t work, you’ll find the same presets in Packages/Cinemachine/Presets/Noise/, and can just drag them into your impulse feedback inspector)
  • 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 setup a regular, non-Cinemachine camera shake

  • in Unity 2019.4.26f1, create a new project
  • from the Package Manager, import Feel v3.0
  • 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 Impulse Source feedback

  • fresh install of Feel v3.0 on 2019.4.36f1
  • 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 MMF Player component to it, position it at 0,0,0
  • add a CinemachineImpulseSource feedback to it
  • via the AddComponent button, add a Cinemachine Impulse Source, drag that component into the ImpulseSource field on your feedback
  • press play, then Play on your MyTestFeedbacks inspector, camera will shake

How to setup a regular camera shake but still target virtual cameras

  • fresh install of Feel v3.0 on 2019.4.36f1
  • from the Package Manager, import Cinemachine
  • create a new, empty scene, add a Cube to it, position it at 0,0,0
  • create a new Cinemachine virtual camera, position it so that it “sees” the cube
  • on the virtual camera, set Noise to BasicMultiChannelPerlin, set NoiseProfile to 6D Shake, AmplitudeGain:0 and FrequencyGain:0
  • add a MMCinemachineCameraShaker to it
  • create a new empty game object, add a MMF Player to it, add a Camera > Camera Shake feedback to it, unfold its CameraShakeProperties and set all Duration:0.3, Amplitude:2, Frequency:40
  • press play in the editor, then play on the MMF Player

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 v3.0
  • 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 change a feedback's property via script at runtime?

For plenty of reasons, you may want to change a property or more on a feedback at runtime. It’s of course possible, and in this example we’ll see how we can change the intensity of a Chromatic Aberration feedback in the Duck demo. It’d be the exact same logic for any other property, on any other feedback.

  • in Unity 2019.4.28f1, create a new project
  • from the Package Manager, import Feel v3.0
  • open the FeelDuck demo scene
  • create a new, empty gameobject, call it RuntimeTest
  • outside of the Feel folder, create a new C# script, call it RuntimeTest, and paste the following in it :
using MoreMountains.Feedbacks;
using MoreMountains.FeedbacksForThirdParty;
using MoreMountains.Tools;
using UnityEngine;

public class RuntimeTest : MonoBehaviour
{
    public MMFeedbacks TargetFeedback;
    [Range(-100f, 100f)]
    public float Intensity = 0f;
    [MMInspectorButton("TestFeedback")]
    public bool PlayFeedbackBtn;

    private MMFeedbackLensDistortion _lensDistortion;
    // IMPORTANT : if you're using a MMF Player, replace the line above with this:
    // private MMF_LensDistortion _lensDistortion;

    private void Start()
    {
        // on start we store our lens distortion feedback component, so that we can target it later on
        _lensDistortion = TargetFeedback.GetComponent<MMFeedbackLensDistortion>();

        // IMPORTANT : if you're using a MMF Player, replace the line above with this:
        // _lensDistortion = TargetFeedback.GetFeedbackOfType<MMF_LensDistortion>();
    }

    public void TestFeedback()
    {
        // we modify our RemapIntensityOne value before playing our feedback.
        // This is done like for any other public attribute on any component in Unity
        if (_lensDistortion != null)
        {
            _lensDistortion.RemapIntensityOne = Intensity;
        }
        // we then play our MMFeedbacks
        TargetFeedback?.PlayFeedbacks();
    }
}
  • then add that script to your RuntimeTest game object
  • select your RuntimeTest object, and drag the FeelDuckLandingFeedback object from your Hierarchy panel into the RuntimeTest’s TargetFeedback slot in its inspector
  • press play in the editor, then select your RuntimeTest object, change the intensity value in your inspector, and press the TestFeedback button, every time you’ll play, the value you’ve changed in the inspector will be sent to the feedback before it plays

One important thing to keep in mind when changing values at runtime is that some of them will get cached for performance reason. So always double check that the value you’re interacting with doesn’t get cached at some point, and that you’re targeting the correct property, or resetting the cache if needed.

How to play a feedback in reverse?

  • select your MMF_Player (or MMFeedbacks), and in its Settings foldout, set Direction to BottomToTop
  • you can also force that via code :
    MyPlayer.Direction = MMFeedbacks.Directions.BottomToTop;
    MyPlayer.PlayFeedbacks();
    
  • you can learn more about direction options in the dedicated section of the documentation

How to trigger a MMFeedbacks with Playmaker?

Note : there are plenty of other ways to do it, and this will also (most of the time) be the same general logic for Bolt and other visual scripting tools.

  • create a new project in Unity 2019.4.28f1
  • import Feel v3.0
  • install Playmaker
  • in a new scene, create an empty object, call it MyFeedbacks, add a MMFeedbacks component to it
  • add a Debug Log feedback to it, set its Debug Message to “Hello!”
  • open the Playmaker editor, right click in it to add a FSM
  • rename that first state to “GettingInput”, and using the Action Browser, add a GetKeyDown action, set its key to F2
  • in the Send Event dropdown, select New Event, name it “F2Pressed”, and press the CreateEvent button, then click on the red label to add transition to state
  • right click in the FSM to add a new state, call it “PlayingFeedbacks”
  • right click on the first state’s F2Pressed event, set its transition target to PlayingFeedbacks
  • right click on the PlayingFeedbacks state, add transition > Finished, then right click on Finished and set its transition target to GettingInput
  • in the PlayingFeedbacks state, using the Action Browser, add a CallMethod action, drag MyFeedbacks’ MMFeedbacks monobehaviour into its Behaviour slot, and in the Method dropdown, select “void PlayFeedbacks()”
  • press play in your Unity editor, now every time you’ll press F2, the feedback will play, and “Hello!” will appear in the console. Any other feedbacks you’d add to your MyFeedbacks MMFeedbacks will of course also play
Jekyll
The PlayingFeedbacks state

How to setup a camera zoom feedback?

  • in Unity 2019.4.26f1, create a new project
  • from the Package Manager, import Feel v3.0
  • 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 v3.0
  • 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 setup a MMFader and fade feedback?

  • fresh install of Feel v3.0 on 2019.4.35f1
  • create a new, empty scene
  • add a UI Image to your scene, set its RecTransform so that it covers the entire screen (usually full stretch and 0 on all left/right/top/bottom, set its Image color to black
  • add a MMFader component to it, this will add a CanvasGroup, set its Alpha to 0
  • in the scene, create a new empty object, add a MMFeedbacks to it, add a Camera > Fade feedback to it
  • press play, play the Feedback, it will “fade in” the fader (fading the screen to black), change its FadeType to Fade Out, it will fade it out back to normal. The Fade feedback’s inspector will let you tweak settings to your liking (duration, curve, etc). If you have more than one fader, make sure the Channel ID on both your fader and feedbacks match.

How to setup a simple Position feedback?

  • fresh install of Feel v3.0 on 2019.4.36f1
  • create a new, empty scene, add a cube to it, position it at 0,0,0
  • add a new, empty game object, add a MMF Player component to it
  • add a Transform > Position feedback to it
  • drag the Cube in its AnimatePositionTarget slot
  • set Transition Mode to Along Curve, AnimatePositionDuration: 1, AnimateX:true
  • press play, play the feedback

How to setup a Scale To Destination feedback?

  • fresh install of Feel v3.0 on Unity 2019.4.35f1
  • create a new, empty scene, add a Cube to it
  • create a new empty object, add a MMFeedbacks to it
  • add a Transform>Scale feedback, set the Cube as its AnimateScaleTarget
  • set Mode:ToDestination, RemapCurveZero:0, RemapCurveOne:1, check all AnimateXYZ checkboxes, set all curves to an ascending curve (0,0 to 1,1)
  • press play in the editor, set DestinationScale to 0.5,0.5,0.5, press Play on that feedback, your cube will shrink
  • set DestinationScale to 0,0,0, press Play on that feedback, your cube will shrink even more
  • set DestinationScale to 1,1,1, press Play on that feedback, your cube will go back to its initial scale

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.

How to setup floating texts to play them via feedbacks?

  • in Unity 2019.4.40f1, Feel 3.0
  • 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 “TestPlayer”, position it at 0,0,0, then add a MMF Player component to it
  • add a new UI > Floating Text feedback to it
  • press play in the editor, then the green Play button on your MMF Player, you’ll see a “100” text spawn every time

Going further : adding intensity control

  • to go further, you can check the “use intensity as value” to have it apply your MMFeedbacks’ intensity to the feedback, like in the following class. To test it, create a new class in your project with the following code, then after the steps above, add the TestIntensityAsValue component to your MMF Player. Press play in the editor, then its TriggerFeedback button, a random value will pop every time. Of course you’ll likely want to pass it some damage value instead of a random one! You’ll notice the value isn’t rounded, if you’d like to change that, you can select a rounding method on your Floating Text feedback.
using MoreMountains.Feedbacks;
using UnityEngine;

public class TestIntensityAsValue : MonoBehaviour
{
	[MMFInspectorButton("TriggerFeedback")]
	public bool TriggerFeedbackButton;
	private MMF_Player _myPlayer;

	private void Start()
	{
		// on start we grab our MMF Player component
		_myPlayer = this.gameObject.GetComponent<MMF_Player>();
	}

	private void TriggerFeedback()
	{
		float randomIntensity = Random.Range(0f, 100f);
		_myPlayer.PlayFeedbacks(this.transform.position, randomIntensity);
	}
}

Going even further : changing values at runtime

  • you can also dynamically change the Value attribute of that MMFeedbackFloatingText component to anything you want, as well as all its other properties. In the example below, we set the value to a random float, and the color to some fancy gradient.
using MoreMountains.Feedbacks;
using UnityEngine;

public class TestModifyAtRuntime : MonoBehaviour
{
	[MMFInspectorButton("TriggerFeedback")]
	public bool TriggerFeedbackButton;

	private MMF_Player _myPlayer;
	private Gradient gradient;
	private GradientColorKey[] colorKey;
	private GradientAlphaKey[] alphaKey;

	private void Start()
	{
		// on start we grab our MMF Player component
		_myPlayer = this.gameObject.GetComponent<MMF_Player>();
	}

	private void TriggerFeedback()
	{
		float randomValue = Mathf.Round(Random.Range(0f, 100f));
		MMF_FloatingText floatingText = _myPlayer.GetFeedbackOfType<MMF_FloatingText>(); // note that this assumes you only have one floating text feedback in your player, see docs for more advanced ways of grabbing it

		// we apply a random value as our display value
		floatingText.Value = randomValue.ToString();

		// we setup some fancy colors
		gradient = new Gradient();
		// Populate the color keys at the relative time 0 and 1 (0 and 100%)
		colorKey = new GradientColorKey[2];
		colorKey[0].color = Color.red;
		colorKey[0].time = 0.0f;
		colorKey[1].color = Color.blue;
		colorKey[1].time = 1.0f;
		// Populate the alpha  keys at relative time 0 and 1  (0 and 100%)
		alphaKey = new GradientAlphaKey[2];
		alphaKey[0].alpha = 1.0f;
		alphaKey[0].time = 0.0f;
		alphaKey[1].alpha = 0.0f;
		alphaKey[1].time = 1.0f;
		gradient.SetKeys(colorKey, alphaKey);

		floatingText.ForceColor = true;
		floatingText.AnimateColorGradient = gradient;

		_myPlayer.PlayFeedbacks(this.transform.position);
	}
}

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

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)

How to play a random sound with randomized volume?

  • create a new project in Unity 2019.4.28f1
  • import Feel v3.0
  • create a new scene, open it
  • create an empty object, add a MMSoundManager to it
  • create another empty, add a MMFeedbacks to it
  • add a MMSoundManager Sound feedback to it
  • set its random sfx array size to 2, set the first element to FeelBlobNote1, the second to FeelBlobNote2
  • set the min volume to 0.2, max volume to 0.5
  • press play in the editor, then press the green Play button at the bottom of your MMFeedbacks, everytime you’ll play a new volume will be randomized

How to setup a channel asset on a feedback and shaker?

In this example, we’ll setup a scale shaker and use a scale shake feedback to trigger it. The same logic applies to all shakers and feedbacks targeting them.

  • in a fresh install of Feel 3.8+, on 2019.4.40f1, create a new empty scene
  • create a new Cube in the scene, position it at 0,0,0, add a MMScaleShaker to it
  • press play, in its inspector, under the Test foldout, press the StartShaking button, notice our cube shakes its scale over half a second, exit play mode

We want to trigger that shaker from a feedback, so let’s establish our channel of communication, and let’s use a MMChannel asset for that, instead of a simple int.

  • let’s first create a channel asset to have our feedback communicate with our shaker (of course if you already have some, you can skip this step), right click in a folder in your project, and do Create > More Mountains > MMChannel. This will create a new MMChannel asset, which you can then rename. Let’s rename that one to MyFirstChannel.
  • select your Cube, and on its MMScaleShaker, set ChannelMode to MMChannel, and drag MyFirstChannel into its MMChannelDefinition slot

We will now setup a feedback to trigger this same shake from a different object.

  • create a new empty object, add a MMF Player component to it
  • add a Transform > Scale Shake feedback to it
  • unfold its Feedback Settings foldout, set Channel Mode to MMChannel, set MMChannelDefinition to MyFirstChannel
  • press play in the editor, then press the green Play button on your MMF Player, the cube’s scale shakes

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!

How to play a 3D sound?

  • fresh install of Feel v3.1 on 2019.4.37f1
  • create a new, empty scene
  • create a new, empty game object, add a MMSoundManager comp to it
  • create a new, empty game object, add a MMF Player to it, position it at 0,0,0
  • add a MMSoundManager Sound feedback to it
  • set its Sound/SFx to BeepLong1, SaptialBlend:1
  • press play in the editor, then play your MMF Player, you’ll hear a beep
  • move the MMF Player to 1000,0,0, play your MMF Player, you won’t hear it
  • move the MMF Player to 25,0,0, play your MMF Player, you’ll hear it at reduced volume

How to play a MMFeedbacks from an animation using Animation Events?

  • in Unity 2019.4.30f1, create a new project using the standard RP
  • from the Package Manager, import Feel v3.0
  • create a new scene
  • create a new cube, position it at 0,0,0
  • add a MMFeedbacks component to the cube, add a Sound feedback to it, set any audio clip in its Sfx slot, like FeelDuckQuack for example
  • add a new Animator component to the cube
  • create a new animator controller, call it CubeAnimatorController, drag it on the Animator component in its Controller slot
  • open the Animation panel, create a new animation, call it BouncyCube
  • add a new property to the animation, Transform:Position, press Record
  • add a key at frame:0, with position to 0,0,0
  • add a key at frame 20, with position 0,1,0
  • copy frame 0, paste it at frame 60, you now have a cube that goes up and down
  • put the cursor at frame 25, and press the AddEvent icon (right below the frame counter), in the inspector, in the Function dropdown, select PlayFeedbacks()
  • press Play in the editor, your cube will bounce, and play a sound every time its animation passes frame 25. From there you can of course add and customize more feedbacks

How to migrate from a MMFeedbacks to a MMF_Player

  • in Unity 2019.4.35f1, create a new project using the standard RP
  • from the Package Manager, import Feel v3.0
  • open the FeelDuck demo scene
  • in the Hierarchy, select the FeelDuckJumpStartFeedback
  • in its MMFeedbacks inspector, unfold the Settings foldout towards the top of it
  • at the bottom of that foldout, press the Convert To MMF_Player button
  • a debug log to the console will tell you how it went, and will let you know if any feedbacks couldn’t be converted (that’d be the case for the old “Haptics” one for example, which doesn’t have an equivalent - there are new and better haptic feedbacks now though!)
  • and that’s it, you’re done, press play, the duck will still quack when you start jumping, existing bindings have been preserved

How to setup a position shaker

  • in a fresh install of Feel 3.5+, create a new, empty scene
  • create a cube, position it at 0,0,0, add a MMPositionShaker component to it
  • in its inspector, under ShakerSettings, set PlayOnAwake:true and PermanentShake:true
  • press play, your cube will now shake at runtime. You can of course customize shake range and direction (and more) from its inspector
  • now exit play mode, and set PlayOnAwake:false and PermanentShake:false, and we’ll create a feedback to trigger that movement on demand instead of having it always on
  • create a new empty game object, name it “Player” and add a MMF Player component to it, then add a Transform > PositionShake feedback to it, via the “Add new feedback” dropdown
  • under Feedback settings, you can define a Channel to target. Our shaker is already on Channel:0 so we’ll leave it like that
  • press play in the editor, then press the green Play button on your MMF Player, the cube will shake
  • still in play mode, let’s set ShakeSpeed:40, ShakeRange:1, Duration:0.75, ShakeMainDirection:1,0,0, DirectionalNoiseStrengthMax:1,1,1
  • press the green play button again, your cube will now shake mostly horizontally, with some randomness on the direction, randomized every time you play it
  • this component lets you customize things however you want, so feel free to explore it! You can also use the MMPositionShaker on rect transforms (make sure to set the appropriate Mode), and you’ll also find shakers for rotation and scale should you need them.

How to add a squash and stretch behavior to an object?

  • fresh install of Feel v3.5+ on 2019.4.39f1
  • create a new, empty scene
  • create a new, empty object, name it TopLevel, position it at 0,0,0
  • then, under it, create an empty child object, also at 0,0,0, name it SquashAndStretch, add a MMSquashAndStetch component to it
  • finally create a cube, parent it under SquashAndStretch (you should now have 3 levels of hierarchy) at 0,0,0 too
  • press play in your editor, select the TopLevel object and move it around, it will automatically squash & stretch

How to disable a certain type of feedback?

Sometimes you want to give players control over what type of feedbacks they’ll get to experience. For instance, it’s common to offer an option to turn down screen shakes, as it can be a problem for people with disabilities, for example. With Feel, doing so is very easy!

  • in Unity 2019.4.39f1, create a new project
  • from the Package Manager, import Feel v3.5+
  • open the Toaster demo scene
  • create a new class in your project, name it ImpulseDisabler, and replace its contents with this :
using MoreMountains.FeedbacksForThirdParty;
using UnityEngine;

public class ImpulseDisabler : MonoBehaviour
{
	public void DisableAllImpulses()
	{
		MMF_CinemachineImpulse.FeedbackTypeAuthorized = false;
	}

	public void EnableAllImpulses()
	{
		MMF_CinemachineImpulse.FeedbackTypeAuthorized = true;
	}
}
  • in your scene, create a new button (GameObject > UI > Button), and position it at 0,0,0 (yes it’s ugly and in the middle of the screen, feel free to put it elsewhere)
  • add your newly created ImpulseDisabler component to this button
  • in the button inspector, under OnClick, add a new entry, drag the ImpulseDisabler component into the slot that appears, and select its ImpulseDisabler.DisableAllImpulses function
  • press play in the editor, then press the CM Impulse button in the sidebar of the scene, the screen will shake, now press the button you created, then the CM Impulse button again, the screen won’t shake anymore
  • that’s it, you now know how to disable (or enable) a feedback of any type with a single line. You can do so for all feedbacks, simply target their specific type!

How to load a scene additively using a feedback?

  • fresh install of Feel v3.5+ on 2019.4.37f1
  • create a new, empty scene
  • create a new empty object, name it Feedback, add a MMF Player component to it, then via its “Add new feedback” dropdown, add a Scene > Load Scene feedback
  • set its SceneLoading/DestinationSceneName to FeelDuck (one of the Feel demos)
  • open your build settings (File > Build Settings), then drag the FeelDuck scene from your Project view into the BuildSettings’ ScenesInBuild panel, then close the window
  • enter play mode in your editor, then press the green Play button on your MMF Player. The loading screen will appear, and transition to the new scene after it loads

How to setup a squash and stretch feedback?

  • fresh install of Feel 3.8 on 2019.4.40f1
  • create a new empty, name it Container, reset its transform
  • create a new Cube, name it Model, parent it under Container, position it at 0,0,0
  • create a new empty, name it Player, add a MMF Player to it
  • add a Transform>Squash & Stretch feedback to it, and drag Container into its SquashAndStretchTarget slot
  • press play in the editor, then the green Play button on your MMF Player