The FlipsideActions component can be used to trigger a number of Flipside's internal actions via Unity events. It can also be used to listen for internal Flipside events and trigger actions in your set when they occur.
You can add a FlipsideActions component to any object in the scene, and only one is required in the scene which can be shared between all components that you want listening for or triggering events in Flipside, however, there's no harm in having multiple instances too.
Triggering actions in Flipside
Here are the steps to trigger a camera move:
- Add a ColliderElement to an object on your set. When this is touched, it will trigger a camera change in Flipside.
- Add a FlipsideActions component to your scene.
- On the ColliderElement, click the + under the OnEnter event, then drag the FlipsideActions component into the newly-created empty slot.
- In the dropdown that says No Function, choose FlipsideActions.MoveToCamera.
- Set the camera number to be whatever camera you want in to move to, starting with 0 for the first camera.
Here's how it should look once it's all setup:
Triggering actions in your set from internal Flipside events
Here are the steps to trigger an event in your scene when an internal action occurs in Flipside:
- Add an AudioSource component to your scene.
- Next, add a FlipsideActions component to your scene.
- Click the + under the OnDisplay event on the newly-added FlipsideActions component.
- Drag the AudioSource into the newly-created empty slot.
- In the dropdown that says No Function, choose AudioSource.PlayOneShot.
- Assign an audio clip to be played when the event occurs.
In Flipside, you should hear your audio clip play whenever the set is finished loading and fades into view.
You can trigger actions in your sets on a number of internal Flipside events. For a full list, see the FlipsideActions component reference.
Next: Creating chairs and teleport targets