Hey,
I’m new to Unity and try to build my first little Jump 'n Run Test Game now.
I want to collect a coin, but the onTriggerEnter2D method doesn’t work.
void onTriggerEnter2D (Collider2D other)
{
Debug.Log ("Trigger Entered!");
// collect a coin
if (other.gameObject.CompareTag ("Coin")) {
coinCount++;
coinsText.text = "Coins: " + coinCount;
other.gameObject.SetActive(false);
}
}
I also made a screenshot of my Player and Coin game object: http://imgur.com/a/AgAL8
Maybe somebody has any tipps, I don’t know what’s wrong.