I’m having trouble figuring how to get a haptics instrument to loop, and also how to set the length of the Haptics Instrument on the timeline to the length of the .haptic clip. So far I have everything working, and can successfully:
- Author a .haptic file in Meta Haptics Studio
- Add it to the timeline of an FMOD event
- Play the haptic instrument (the controller vibrates correctly)
- Play the haptics at runtime in Unity
Essentially everything is working on the technical end, but in FMOD Studio, it appears that a some basic/necessary functionality is not showing up?
The TL;DR is:
- It seems like Haptics Instruments’ playback behavior is always Async (not necessarily what I expected but ultimately not a big deal)
- It seems like there is no way to loop the .haptics asset within a Haptics Instrument
- It also seems like you can’t use “Resize to Content’s Length” on a Haptics Instrument, which means you can’t easily put a loop region around the Haptics Instrument on the timeline either
- I’m pretty certain that looping behavior isn’t specified when creating the actual .haptic asset file
And so my question is:
How do you author basic looping behavior for haptics?
(And also how do you make a Haptics Instrument on a timeline be the duration of the .haptic that it plays?)
Is looping just done in a different way that I don’t know about? Because with where I’ve gotten so far, it looks like you can’t loop a controller vibration until you tell it to stop in the same way you often need to be able to do with sounds. I thought it was supposed to be as easy as clicking a single button.
Ok, that was the TL;DR. You can absolutely not read the rest of this in order to understand my question. Nevertheless, the following is the short novel I wrote at first about how I investigated all the ways I thought I could be overlooking a slightly different implementation of that feature, which after writing I realized it would practically be rude to not add a TL;DR. The above it really all there is to my actual question, but feel free to experience the journey I went on trying to figure out how to loop haptics:
First, dragging a .haptic file onto the timeline directly from the assets browser will create a Haptics Instrument as expected (just as dragging an audio clip will create a Single Instrument), except no matter which .haptic clip I drag into the timeline, the created Haptics Instrument is always one second long, regardless of the duration of the .haptic clip, so it is always longer or shorter than the actual haptic feedback that it plays.
This wouldn’t normally be an issue at all, except when right clicking on the Haptics Instrument, the context menu is missing the “Resize to Content’s Length” option that you find when right clicking a Single Instrument or Multi-Instrument.
Another issue is looping a .haptics clip or Haptics Instrument. From initially trying to contain the Haptics Instrument clip on the timeline within a Loop Region, it quickly becomes obvious that the Haptics Instrument is treated as Async. That’s totally fine, but often when working with Async you also set the content of the Async instrument to loop. There are essentially no controls in the Deck for a Haptics Instrument that affect playback behavior at all, which is where I would expect to find the option to loop the .haptic asset within the Haptics Instrument that’s on the timeline.
And then this brought me back to the previous issue, because my next idea was to at least put the Haptics Instrument inside of a loop region. But that is essentially guaranteed to be imperfect, because unless I author a .haptics clip that’s exactly 1 second long, I can’t reliably set the length of the Haptics Instrument to match the length of the .haptics clip that it’s playing without the “Resize to Content’s Length” operation that is absent from the Haptics Instrument’s context menu.
So my next assumption was that looping isn’t meant to be handled in FMOD, but rather in Meta Haptics Studio when authoring the .haptic asset. That seems to not be the case either, because over there as well there doesn’t seem to be anywhere to define loop points either. Eventually I found an example project with a .haptic clip that was meant to be used as a loop, and between that and some of that project’s documentation I concluded that looping is not defined in the authoring of a .haptic asset, but rather it is handled when that asset is implemented. That example project was assuming the use of their SDK for the relevant game engine, which implies that the loop behavior must be intended to be created in Unity with their Unity Haptics SDK. Buuuut…
Isn’t the whole point of the Haptics Instrument supposed to be that FMOD can be used for haptics implementation as an alternative to the Unity Haptics SDK? The Meta Haptics website has an entire page about how it can be used with FMOD or Wwise which includes a paragraph under the heading “Work entirely within FMOD or Wwise”.
The example project I found with a loop .haptic clip also had a matching "start’ and “stop” clip with it, which means the intended implementation is almost certainly to have all three in their own Haptics Instruments, with at least the start Instrument being the exact length of the .haptic asset, so that the playback can go seamlessly from the start sound to the loop sound as soon as the playback reaches the exact end of the start clip. And looping the loop clip would either use a loop region for the Haptics Instrument or loop the .haptic asset within the Instrument.
But without “Resize to Content’s Length” I don’t see how this implementation could be done in a way that isn’t excessively time consuming and clearly a workaround, and even still, there are many circumstances where the expected way to do it is by looping the contents of the Async Haptics Instrument clip rather than using a loop region for the Instrument itself.
So anyway, yeah. How do you loop haptics?