How to vibrate the ios and android device from unity C# code?

Hi Guys,

I want to vibrate the android and ios device when the user destroyed a large number of enemies.So,I try Handheld.Vibrate & IphoneUtils.Vibrate on ios7 devices but it is not working at all. Please provide the solution for this asap.

Priyanka Tyagi

This works fine for me…:

function OnGUI () {
	if (GUI.Button (Rect (0, 10, 100, 32), "Vibrate!"))
		Handheld.Vibrate ();

iOS opened up vibration only since iOS 10.

There is a plugin for the new vibration features on the asset store: Unity Asset Store - The Best Assets for Game Making

Hi, so… here is a blog post about Vibration in Unity: