Feel Integration Demo Scene
v1.0
For this guide, we'll be looking at the Juicy Actions Feel Integration Demo scene in the Feel Integration folder. The scene is complete, but you can use a copy of the Feel demo scene from GettingStartedTutorial if you'd like to implement the changes along the way.
We will go over multiple topics:
Calling a
MMF_Playerfrom Juicy ActionsExecuting Actions based on Feel events
Handling time between Feel & Juicy Actions
Executing Juicy Actions on
MMF_Playerstatus (Start, Complete)
Multiple strategies for connecting Feel and Juicy Actions are presented in this guide. Most likely you'd choose a stategy you like for your project, and re-use it multiple times. This guide seeks to provide an overview of some of the options you have.
Playing a Feel Feedback
Add to the Hero object an ActionOnKey component. Also update the GettingStartedTutorialHeroReference to no longer use the Space key.

Add a FeelPlayFeedbackAction Action, and assigned the JumpFeedback to the Feedback Player field.
Now pressing Space in the scene will make the object jump. The actions are driven by Feel, but the trigger is driven by Juicy Actions.
TODO: Add teh jump action!


Action on Feel Event
For each MiniCube remove MMFollowTarget and MMPositionShaker (or other similar components). Add an ActionOnFeelEvent component. This will execute Actions whenever a Feel event that you specify is called.
TO DO REMOVE POSITION SHAKER
TO DO ADD POSITION SHAKE TO FEEL

Under the Hero object, select the LandingFeedback and add a Position Shake action.

Then in the MiniCube, set the ActionOnFeelEvent toggle for Position to true.

Add some Actions to the ActionExecutor list on the ActionOnFeelEvent. In this case we'll add a MoveAction, ScaleAction, and SpinAction. Set the durations of these to 0.6 seconds.
For this demo scene:
Move target position
0, 1, 0with a curve that you likeScale to
2, 2, 2with Scale Mode set toPercentageChoose a curve you like for the Spin
Feel free to test, but once you like the settings, you can copy them to the other MiniCube objects, or just copy the entire component and paste values. Enter play mode and press Space to trigger the events.

Slowing Down Time
Lets slow things down. Start by adding a MMTimeManager component onto a new object in the scene.
Check to make sure the JuicyActionsSettings object in the Project view has the Sync Unity Time Scale option set false. When true, the Unity.timeScale value is synced to the Juicy Actions Clock time scale.
For this demo, we're going to keep that off so that we can manipulate time through Feel.
On the Sphere object, add an ActionOnFeelEvent component, and add two Actions: FeelFreezeFrameAction, and FeelSetTimescaleAction.

Open up the "Options" in the ActionExecutor and switch from Action Clock to Unscaled for Execution Timing, and click the "Clock" icon in the FeelFreezeFrameAction header row to make the timeBeforeNextAction be determined by the Action itself.

This way, the ActionExecutor will not call FeelSetTimescaleAction until after the freeze has ended.
Both of these actions utilize MMTimeManager.
TODO Add the time manager object
Now when we press play, the Sphere will slow down, but the MiniCube objects do not. This is because they are using Action Clock as their timing solution, set in the ActionExecutor in the Inspector.


If your project does not need to have separate time control, you can toggle Mirror Unity Time Scale to true in JuicyActionsSettings.
When true, the Action Clock deltaTime will use Time.deltaTime as its base value. It can still adjust it's own timeScale sparately, but it will inherit the Unity Clock Time Scale.
Back to the Sphere object, toggle off "Simple Mode" by clicking the Simple button to see all the options in each of the Actions.
In each one, toggle on the override for Set Juicy Actions Time Scale by clicking the circle to the left — it will turn yellow indicating the Action is overriding the default values. Then toggle on the bool.

Now press play again, and the Juicy Actions clock will also be set by those actions — allowing you to set both while keeping the two TimeScales independent.

Adding More Juicy Juice
Find the CM vcam1 object, and add the ActionOnMMFeedbackStart component. Assign the JumpFeedback to the MMF_Player field.
Add SetVirtualCameraFieldOfViewAction to the ActionExecutor list. Set the Target FOV to a value you prefer (the default for the camera is 60, and a smaller number will zoom in, closer to the object).

Also set the Duration and Value Curve to something that you like. Press play and see the result.

Triggering and Reacting to MM Game Events
You can trigger MM Game Events from an Action, and you can react to events with ActionOnMMGameEvent.
Find the Hero, and add a FeelTriggerGameEventAction to the ActionOnKey list.

Find the OnGameEventDemo object in the scene, and add an ActionOnMMGameEvent component.
Add a RendererColorChangeAction to the list, and turn off Simple mode. We're going to customize this Action quite a bit — turn on the override for each field by clicking the circle icon on the left.
Set Duration to
0.5Choose a Value Curve that you like, which starts and ends at
Y0Set Return To Base Value
trueSet Use Current Value as Base
falseAssign the Sphere to the Renderers list
Choose a number of different colors for the Colors list
Set the Color Selection Mode to Random No Repeat
Assign a white color as the Base Color
The custom shader uses "_Tint" for the color property, so assign that to Custom Color Property

Next, add a ScaleSpringAction. Turn off Simple mode.
Assign the Sphere to the Transforms list
Set the Target Scale to
2, 2, 2Set the Scale Mode to Absolute
Set the Time Before Next Action to
0.2in the Action header

Duplicate this action by pressing the "D" button in the right side of the Action header.
In the new copy, set the Target Scale to 0.5, 0.5, 0.5. These two actions back to back will scale the Sphere up and then back down with a spring-like motion.

The timing on when each Action starts is controlled by the Time Before Next Action values. The first two actions will happen immediately, but the last action will start 0.2 seconds after the first ScaleSpringAction starts. Enter play mode and test it out.

That's it for this guide! We integrated Feel and Juicy Actions by triggering Feedbacks and Actions from each system to the other, triggered and responded to MM Events, handled time changes, and more.
Check the rest of the integration docs for more specifics on the options available.
Last updated