Roll-a-ball not picking up cubes

Hey guys,

I’m new at this so I started with the tutorial: Roll-a-ball. I’m now at section 3.02.
I made the script to trigger the pick ups. I can roll the ball (player) put I cant pick up the cubes.
The ball just rolls through to the cubes and they don’t disappear. I got the tag for the cubes copied from the script so I know for sure that the tag is good. I hope you can help me.

public class PlayerControler : MonoBehaviour {

    public float speed;

    private Rigidbody rb;

    void Start ()
    {
        rb = GetComponent<Rigidbody>();
    }

    void FixedUpdate ()
    {
        float moveHorizontal = Input.GetAxis ("Horizontal");
        float moveVertical = Input.GetAxis ("Vertical");

        Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);

        rb.AddForce (movement * speed);
    }

    public class ExampleClass : MonoBehaviour
    {
        void OnTriggerEnter(Collider other)
        {
            if (other.gameObject.CompareTag("Pick Up"))
                other.gameObject.SetActive(false);
        }
    }
}

You should ask on the proper forums: Roll-a-ball Tutorial Q&A - Learn Content & Certification - Unity Discussions

Okey sorry about that. Thank you for the link.

Well why do you have another class in the code? I’d do it like this:

public class PlayerControler : MonoBehaviour {

    public float speed;

    private Rigidbody rb;

    void Start ()
    {
        rb = GetComponent<Rigidbody>();
    }

    void FixedUpdate ()
    {
        float moveHorizontal = Input.GetAxis ("Horizontal");
        float moveVertical = Input.GetAxis ("Vertical");

        Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);

        rb.AddForce (movement * speed);
    }

        void OnTriggerEnter(Collider other)
        {
            if (other.gameObject.CompareTag("Pick Up"))
                other.gameObject.SetActive(false);
        }
}

Also make sure you set up the colliders correctly as shown in the tutorial.