So I am having this crazy issue. I am collecting coins in a platformer. The coins have a box collider that has isTrigger enabled/checked. This coin is an Animated Sprite that has a tag of coin. My player has a child gameObject that has a rididbody and capsule collider. In my player script I have the following:
void OnTriggerEnter(Collider other)
{
if (other.CompareTag("coin")){
Debug.Log ("Hit");
}
}
What could I be doing wrong. This seems pretty straight forward. I just want to detect the collision in the console and move from there. I have also tried the following:
void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "coin"){
Debug.Log ("Hit");
}
}