Roll a ball collisions not picking up on build...

Works fine in the editor - checked the tags a million times! Am I being dense? Noob alert!!

here’s the PlayerController script…

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class PlayerController : MonoBehaviour {

    public float speed;
    public Text countText;
    public Text winText;

    private Rigidbody rb;
    private int count;

    void Start ()
    {
        rb = GetComponent<Rigidbody>();
        count = 0;
        SetCountText ();
        winText.text = "";
    }

    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("Trying Here"))
        {
            other.gameObject.SetActive (false);
            count = count + 1;
            SetCountText ();
        }
    }

    void SetCountText ()
    {
        countText.text = "Count: " + count.ToString ();
        if (count >= 12) {
            winText.text = "You Win!";
        }
    }
}

I have this same issue with the tutorial. Everything works in the game view in the editor but in the build collisions aren’t being detected.

After further investigation I figured out the solution to this problem. The tags for the pickups were not attached correctly. I untagged all of my pickups, then retagged with my “Pickup” tag (in @fawce 's case “Trying Here”) tested again in the Game view, worked; built the app and it worked as it should!

Hope this helps the next in line…

1 Like

Thanks pez, that did the trick