DISCLAIMER : This question was for a school project that was not finished because of this bug. The project being over, proposition for future developers can be done but I can't validate any of the answers as I don't have access to the source code anymore.
I'm currently creating a drum simulation for a school project using HTC Vive and Unity 3D.
In order to do that, I used a BoxCollider on the toms and the method :
void OnCollisionEnter(Collision col)
{
GetComponent<AudioSource>().Play();
}
So that the sound plays when the HTC Vive remote touches a tom. The trouble is that the sound keeps playing as long as the remote touches the tom instead of playing once on collision.
I also tried the OnTriggerEnter()
method with the same result.