I’m working on a VR shooter which involves shooting enemies with a gun. However the bullets are not detecting collision with my enemy game objects. My bullet script is:
void OnCollisionEnter(Collision coll)
{
Debug.Log(coll);
if(coll.gameObject.name == "Enemy")
{
Destroy(coll.gameObject);
}
this.gameObject.SetActive(false);
}
Is there something wrong with my code or something I didn’t add? I’m generally new to both Unity 3D and openVR development.