- Home /
Roll a ball pickups not working after exe is built
I just finished the roll a ball tutorial. All was well until I went through the build process.
The game works as anticipated in the editor (play) function, but when i build it; the "pickup object" script doesn't seem to be running or trigger collision is not working properly. The ball rolls right through the pickups and the UI is not updated.
What I have tried: I have built several times with for windows 32 & 64 bit with the same result. I tried full screen and windowed mode thinking the collision position may not be in sync with the render.
I have checked both output_logs and see no obvious issues.
I'm using Unity 5.6.0f3 Personal (64bit).
Thank you in advance for your assistance
-Jordan
P.S. The potentially offending script:
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("PickUp"))
{
other.gameObject.SetActive(false);
count++;
SetCountText();
}
}
$$anonymous$$ake sure the pickup objects have the correct tag, capitalized exactly like your check. Remove the tag and add it again just to make sure - that's what's fixed this issue for other people.
Thanks $$anonymous$$arshallN.
I received a similar response from Adam-Buckner on the roll-a-ball tutorial forums that helped me resolve it.
Other forum response
Try checking the tags menu.
There is a peculiar issue when creating tags and then exiting the project without saving properly or using undo after making the tags (I've not found the exact trigger) where the tags seem to be assigned (eg: the prefab and the instances say the "PickUp" as the tag) but when checking the tags and layers menu, the tag doesn't exist. As the prefabs seem to feel that they have been successfully tagged, they work in the editor. However, when the project is built, the tag doesn't actually exist, so it won't run.
I've seen this reported a few times over the years this project has been around, but it's rare enough that I've never been able to track down the exact sequence of events that allows this to happen.
SO:
Check the pickups and make sure they are tagged. Check the tags and layers menu and see if the tag exists. If it doesn't exist, recreate the tag and then reassign that tag, if necessary, to the prefab and double check that it has propagated to the instances.
In my case each individual pickup and the prefab were properly tagged and the tag did exist. When i opened the tag/layers menu and re-saved and rebuilt it just seemed to resolve the issue.
Glad you found the issue! Yeah, you didn't do anything wrong, Unity occasionally just messes up, haha.
Answer by Damx324 · May 17, 2018 at 02:46 PM
Slightly old topic but may help ... One possible cause for this is if there is a deleted tag in your tags list, Unity will hold open these until the project is reloaded. This can cause the wrong tag number to be built into a project.
Answer by jhirsh · May 17, 2018 at 03:36 PM
Thank you for the answer Damx324. I don't recall how or if I resolved this, but your suggestion makes sense.
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
How do i stop an asset from deleting the ground when it dies? 0 Answers
crash build version on colliding with Kinematic collisions 0 Answers
OnTrigger Box Collider Doesn't Work? 1 Answer
Cant get Collisions to work 3 Answers