So I have this bit of code which is similar to the one given in the 'Roll-a-Ball' tutorial: Code (CSharp): using UnityEngine; using System.Collections; public class Player : MonoBehaviour { public float speed = 2.0f; private Rigidbody2D rb; // Use this for initialization void Start () { rb = GetComponent<Rigidbody2D>(); } // Update is called once per frame void Update () { float moveHorizontal = Input.GetAxis("Horizontal"); Vector2 movement = new Vector2(moveHorizontal, 0.0f); rb.AddForce(movement * speed); } void OnTriggerEnter (Collider other) { if(other.gameObject.CompareTag("Collectible")) { BallCreate.score++; Debug.Log("went"); Destroy(other.gameObject); } } } For some reason the collectible does not notice the trigger enter. The collectible has the 'Collectible' tag with a big C and all of my stuff has 2D colliders on them + the player ball has a 2D rigidbody. I had the other.tag == "Collectible" in the if clause at first, but it didn't work with that either. When I turn off the 'is trigger' checkbox on the collectible, my player ball is stopped by its collider. Really weird. What could be wrong?
You can't use OnTriggerEnter with 2D colliders cause it only works with 3D. There is a separate function that works with 2D colliders, which is: Code (CSharp): void OnTriggerEnter2D (Collider2D other) Hope this solve your issue!