PlayMaker

States

The initial state is used to initialize (you can set the object into initial status).

It starts with the script’s launch.

Each state has its own list of action. To add an action, you should press button 6 (Action Browser).

State changes from one to another are done using the events.

Events

While sending an event you can select the Event Target: Broadcast All (as finite state machines that are on), to GameObject itself, or to GameObject and all of its sub-objects.

Sounds

AudioClip can be played by setting any GameObject where the audio source is present.

To switch the state when the sound is over, select the event in “Finished Event” field.

Scripts (on the fade example)

To create a script with the possibility to copy and paste, let’s create a variable with a link to the script:

  1. Create a variable with Type Object.

  2. Select script type (Assets - Scripts - Script - Fade).

  3. Get it into variable.

  4. Create global events FadeIn and FadeOut.

  5. Add to Init state the switch of two events (FadeIn, FadeOut) and return back.

  6. Using the variable, set the properties and launch the script.

Event properties

While sending the event, you can set some Event Data:

Depending on the data, you can get it and set the needed values, e.g. in Vector3, we send start (X), end (Y), time (Z) values for Fade.

To get the sent data, use action “Get Event Vector3 Data”.

Vyzn specific events

If you want to call one of the voice commands that are supported by Vyzn, fire the event "VYZN_VOICE" putting in the data the desired voice command.

Note

Keeping in mind the variability of the final model size, care should be taken when using the Play Maker. It is recommended not to create a sequence where execution may depend on the path length of movement of objects. For example, if the action "move towards" is used and the model size is increased, the final position of the model will be unpredictable. Priority should be given to the action "move object", which makes movement to a given position for a fixed time regardless of the path.

See additional information about PlayMaker here - hutonggames.fogbugz.com