Ok I was able to make it work.
Everything was pretty much ok except for the handling of collisions.
Since you have set IsTrigger on the SphereCollider of your BounceyBall:
you need to use OnTriggerEnter to detect triggers
I have changed your script with this and it works on the editor dragging the sphere with the mouse in the scene (I haven’t tried on the Quest yet)
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("ball"))
{
Debug.Log($"CubeController: {this.name} TRIGGER with BALL {other.gameObject.name}");
if (rend.material.color == offMaterial.color)
{
rend.material = onMaterial;
camera.GetComponent<MainController>().EnableCubeToPlaySound(cubeIndex);
}
else
{
rend.material = offMaterial;
camera.GetComponent<MainController>().EnableCubeToPlaySound(cubeIndex);
}
}
}
Some other notes:
I created a prefab for the cubes, and a single PitchShift script that I use on all of them, just reassigning the Spheres and changing the channelName.
I commented out the OnCollisionEnter section inside the BouncyBallHit script, since it’s superfluous, you’re handling the trigger in the CubeController already, and it was calling the same method:
mainController.EnableCubeToPlaySound(index)
that is called above OnTriggerEnter.
Here is a unity package with the scene and its dependencies:
VR_Sequencer.unitypackage (62.4 KB)
except the Auto Hand scripts, and all the rest that you should already have. As a matter of fact I think you shouldn’t share a project that uses a paid plugin, maybe we should remove that link you posted above
Let me know if it imports correctly and if it works as expected!