Description

Create haptic effects (vibrations) on Android with this easy to use asset. You can set your Android device to vibrate for a specified amount of time or through patterns of varying lengths. Simple demo is included. Since this asset relies on a native Android extension, the haptic effects will not work when running or debugging, you need the create an apk to test the functionality.

Important!: Please update this extension to the newest version. The vibrate functions as they were have been deprecated in SDK version 26 (Android 8.0) and cause problems on newer devices. The newest version of this extension includes a Java file that uses the updated functions that you can use if targeting SDK version 26 or higher. Please test this out and contact me if there are problems before leaving a bad review and I will look into it, thanks!

Please note: Set minimum sdk to at least 11. If you target API level 26+ (Android 8.0+) in GMS2, then copy the included file "Haptics_SDK26.java" to [Project]/extensions/Haptics/AndroidSource/Java. Take a backup of and remove "Haptics.java" already in that directory and rename "Haptics_SDK26.java" to "Haptics.java".

Functions:

  • Haptics_HasVibrator()
  • Haptics_Vibrate(milliseconds) // Set argument to -1 to vibrate indefinitely
  • Haptics_VibrateIntensity(milliseconds, intensity) // Intensity can be the values 1 to 5, set first argument to -1 to vibrate indefinitely
  • Haptics_Pattern2(vibrate1_ms, pause1_ms, vibrate2_ms)
  • Haptics_Pattern3(vibrate1_ms, pause1_ms, vibrate2_ms, pause2_ms, vibrate3_ms)
  • Haptics_Pattern4(vibrate1_ms, pause1_ms, vibrate2_ms, pause2_ms, vibrate3_ms, pause3_ms, vibrate4_ms)
  • Haptics_PatternString(pattern_string) // Comma delimited string for longer and more advanced patterns
  • Haptics_PatternStringRepeat(pattern_string) // Like the function above, but pattern will be repeated indefinitely
  • Haptics_StopVibration() // Stop vibration, use when device has been set to run indefinitely using any of the functions above

You are allowed to use this asset in any game you make, commercial or free, but you are not allowed to include this asset in other assets on the Gamemaker Marketplace.

End User Licence Agreement (EULA).

Changes in 1.3.1

  • Should now work with API level 26+ (Android 8.0+)

Version 1.3.1. Published October 2, 2018

Created with GameMaker: Studio v1.4.1772

Age Rating: 4+

Average Rating

Your review

You can only review assets you've bought.


Gravatar

Anonymous 27 October 2018


Gravatar

Anonymous 27 October 2018

Problems with new phones

Hi, some people is having issues with the vibration. I guess it happens because of SDK issues and because they are having new phones.

When are you planning to update it?

Edit: developer answered quickly and updated the extension. Now works perfectly

Logo

Mick @ GamePhase (Publisher) 02 October 2018

I have now updated the extension so it should work for Android 8.0+ phones. You need to replace Haptics.java with the one I attached under included files when targeting API 26+. See the "details" tab for more information. Hope it works for you!


Gravatar

Samir L 02 June 2018

Frame drops

Hi, I get huge frame drops while the function is activated (i:e rumbling). Also the console show: Can't find method on Extension class null.

Android YYC, Vibration are working tho', it's just they cause huge frame frops ( from a steady 60fps to 10fps or less)

This review was left for a previous version of this asset.

Logo

Mick @ GamePhase (Publisher) 02 October 2018

Hi, The vibration functions have been deprecated and changed in Android 8.0, this is probably the reason for your problems. I'm looking into it.

EDIT: I have updated the extension so it should work with Android 8.0+. I'm not sure if this was the problem you were experiencing. I read at some point that there was a bug in GMS2 regarding sending double as parameters to an Android extension.


Gravatar

Chris M 15 April 2018

This review was left for a previous version of this asset.


Gravatar

Winter T 17 November 2017

Great product

Great extension, absolutely worth the $2. It's such a shame that vibration effects are no longer natively included in GM:S.

This review was left for a previous version of this asset.


Gravatar

Chris C 31 October 2017

Perfect

Extremely easy to use! Works with GMS2 - great extension.

This review was left for a previous version of this asset.


Gravatar

Anonymous 24 July 2017

This review was left for a previous version of this asset.


Gravatar

nam i 21 May 2017

Worked successfully on GMS2

GOOD!
Additionally, It works in upper than sdk 11.

This review was left for a previous version of this asset.

Package contents

Loading, please wait

What is the issue?

Back to Top