Handheld.Vibrate() not working

I want to make my phone vibrate when two objects collide (2d game), so i tried this:

using UnityEngine;
using System.Collections;

public class Vibrate : MonoBehaviour {

void OnCollisionEnter2D(Collision2D collision){
	if(collision.gameObject.tag=="myTag"){
		Handheld.Vibrate();
	}
}

}

but it is not working.

Found a solution - so, if anyone has the same problem as I had here goes:

  • you need to build and run, or make an apk file and it will work. Unity Remote doesn’t allow vibrate if you just press play.
  • also - game doesn’t look as good on the mobile if you just press play, but if you click build and run it will look the way it should.

Basically, it is a Unity Remote issue.

I have that problem. Tho the solution in mine was I changed the void from private to public or just void.

Could this be fixed in future versions of unity remote does anyone know?