Hello @Reditect,
If you want to trigger a certain intensity with certain duration in the new form of HapticEffect, please use Custom type HapticEffect. Your code will look something like the following
if useNewHapticEffectSystem then
UseHapticFeedback.OnClientEvent:Connect(function(howLongShouldTheRumbleLast,howIntenseShouldTheRumbleBe)
local waveformKeys = { FloatCurveKey.new(howLongShouldTheRumbleLast, howIntenseShouldTheRumbleBe) }
local hapticEffectInstance = Instance.new("HapticEffect")
hapticEffectInstance.Type = Enum.HapticEffectType.Custom
hapticEffectInstance:SetWaveformKeys(waveformKeys)
hapticEffectInstance.Parent = workspace
hapticEffectInstance:Play()
end)
else
...
end
Also notice that the instance you create could actually be reused and reassigned to the new intensity and duration, instead of being created every time there is an event. I will leave that to you to decide how to fit this into your experience.
Regarding the 2nd question: As of now, we don’t expose the haptics option in the User Settings, but we can look into exposing them if there is more use case around this property.
Hello, I’ve come across these haptic effects and I really like them, but I have a few questions in mind.
First, is it mandatory to specify a “Parent” for the haptic effect? In other words, if we don’t set a Parent and the haptic effect’s Parent is nil, will it still work? (I don’t have a controller, so I can’t test this right now.) Additionally, after creating the haptic effect and calling “Play,” will there be a function to indicate when the vibration has ended? This would allow us to perform garbage collection and destroy the haptic effect once we’re done with it.
Second, Roblox provides us with various HapticEffectTypes. Where can we find the actual FloatCurveKey values for these? For example, what are the real values for something like UINotification?
local uiNotification = {
FloatCurveKey.new(),
FloatCurveKey.new()
-- etc.
}
Hi! Bug report here! Every time i add the new haptic instance in any UI, it for some reason, gives error 260 “Error while receveing data, please reconnect.” I added this in one of my games, and it took the CCU to 0. This should be fixed quickly as developers may not notice it due to it not appearing on studio.
Hi @bluepear_2
The feature is currently only available for testing in Studio and isn’t supported in published experiences. Please remove the HapticEffect instances from your game and republish — that should resolve the issue. Thank you!
Yes, the HapticEffect instance needs parenting to work. And there is no function to indicate the ending since we would expect this to be “fire and forget”. That said we can potentially add an event that will trigger when the instance has finished playing, would that be something you are looking for?
Currently, we don’t expose these values in our documentation, but we can share them in a post to help guide custom waveform design if that’s helpful.
For the first point, yes, an event that triggers when the haptic effect has finished playing is exactly what I’m looking for. This would be incredibly useful.
For the second point, sharing the FloatCurveKey values for the HapticEffectTypes in a post would be greatly appreciated. Having access to these values would significantly simplify the process of designing custom waveforms and creating our own patterns.
Additionally, I believe adding a Pause function could be beneficial for developers. Such a feature, allowing the haptic effect to be paused and resumed from where it left off, would provide greater control and flexibility in implementing haptic feedback.