🔥NOTE: The Studio plug-in for Unity is currently in beta and under development. Information on this page is subject to change.
Haptic clips are created with either the Studio desktop app or the Studio web app. A haptic clip contains high-definition, device-agnostic haptic data that the Studio plug-in for Unity uses to create an optimal haptic effect on playback devices.
The Studio plug-in for Unity implements haptics in a similar fashion to Unity’s own audio system whereby
Haptic Source components are placed onto game objects and assigned various haptic clips taken from Unity’s Streaming Assets, and those haptic effects are then received by the
Haptic Receiver component typically attached to the Main Camera.
Any haptic clip that you wish to use in your Unity application must first be added to the project. Specifically, the haptic clips (files ending with the extension
.haptic) must be added to the streaming assets of the project which is located in your project at
Assets/StreamingAssets/Haptics. You can either directly drag haptic clips to this folder in Finder/Explorer, or you can drag them into the Unity Project Explorer.
The haptic clips you add to this location will be selectable via the
Haptic Source component, explained next.
Click on a
GameObjectin the scene hierarchy to which you want to assign a haptic clip:
In the Inspector, click “Add Component”:
Type “haptic” in the search box and select
Haptic Sourcefrom the list:
In the inspector for this component, select a haptic clip from the ones you have earlier placed in