We have redirected you to our new domain: store.godotengine.org. Please update your bookmarks!

Description
Changelog
Reviews

A plugin to add support to clear and rich haptics, as opposed to the default buzzy haptics that Godot offers.

Think about the vibrations used by apps such as Duolingo or Brawl Stars :)

Usage

Check haptics_wrapper.gd, but in short:

haptics = AndroidHaptics.new()
haptics.vibratePrimitive(AndroidHaptics.Primitive.THUD, 0.5) # primitive, intensity
haptics.vibrateEffect(AndroidHaptics.Effect.TICK) # effect
haptics.Composition.new()\
    .addPrimitive(AndroidHaptics.Primitive.SLOW_RISE, 1.0)\
    .addPrimitive(AndroidHaptics.Primitive.THUD, 1.0, 500)\ 
    .vibrate() # primitive, intensity, delay(ms)

var wave = AndroidHaptics.Waveform.new(
  [ 100, 100, 80,  80, 30,  30, 150, 40,  40, 200],
  [ 60,  0,   120, 0,  255, 0,  0,   255, 0,  0],
)
wave.play()

# @export var curve: Curve
# var wave = AndroidHaptics.Waveform.from_curve(curve, 2000, 20, 100)

haptics.stopVibrations()

Also check out the simple demo

The minimum Godot version shown here is simply the lowest Godot version I have personally tested this plugin with. It might work with lower ones!

Recommendations

There's likely no better resource than the Android documentation itself. Most functions provided here will work very similarly to the ones used in native Android code. Not only that, the high level concepts can be easily re-used as well:

  • Favor rich and clear haptics over buzzy haptics.
  • Be consistent, both with the system and the app design.
  • Be mindful of frequency of use, and importance.

Changelog for version v1.1

No changelog provided for this version.

Reviews (0)

Android Rich Haptics has no reviews yet.

Login to write a review.