Usage in a Scene (Unity)

Updated: 11/14/2023

This page contains statements regarding the beta version.

This method uses motion-sync tied to Cubism models using the Cubism SDK MotionSync Plugin for Unity.

Model Preparation

Prepare a model with .motionsync3.json and .model3.json containing a reference to .motionsync3.json.
If you are using Cubism 4.2 or earlier, please refer to “Usage with Cubism 4.2 or Earlier Models” to prepare model data.

Once the model data is ready, import the model into Unity.
See the Cubism SDK for Unity Tutorial “Import SDK” for information on importing.

Setting Scenes

If the Cubism SDK MotionSync Plugin for Unity has been imported and motion sync settings exist in the model’s .motionsync3.json, a CubismMotionSyncController component and a component inheriting from ICubismMotionSyncProcessor will be attached to the model’s root object.

In the image, the CubismMotionSyncController component and the CubismMotionSyncCriProcessor component are attached.
The operation of the CubismMotionSyncCriProcessor component requires the CubismMotionSyncCriAudioInput component to receive the audio to be analyzed.

Components inheriting from ICubismMotionSyncProcessor are attached as many times as the number of settings listed in .motionsync3.json.

Analysis Settings

To analyze the audio, CubismMotionSyncCriAudioInput must be attached to any object below the root object of the model.

When this component is attached, AudioSource is automatically attached.

The CubismMotionSyncCriAudioInput component has the following configuration items.

  • BufferLengthPerSecond
    • Size of ring buffer for audio data used for analysis. Default is 1.0.
    • If a value less than 1.0 is entered, it is clamped to 1.0.
  • ListeningChannel
    • Sets the audio channel to be used for analysis by index number. Default is 0.
    • Only the audio information for the specified channel is used for analysis.

Adding audio files

This section describes how to handle audio files directly and motion-sync the model.
Attach the audio file to the AudioSource component that was attached in the “Audio Playback and Analysis Settings” section.

Playback and operation

This will apply motion-sync to the model.

Was this article helpful?
Please let us know what you think about this article.