Unity 3D Game Engine – How to make an android device vibrate

1. Hierarchy> Main Camera> attach the script ‘Vibrate.js’

Vibrate.js


function Update () {
   
}

// Press button to vibrate START
function OnGUI () {
	if (GUI.Button (Rect (0, 10, 100, 32), "Vibrate!"))
	Handheld.Vibrate ();
}
// Press button to vibrate END