The question is answered, right answer was accepted
Build Achievement system not working
Not working in the build. The achievement unlocking system works in the editor but not when I make a build of the game. The example is in the link. The achievements are prefabs that change in the editor but not in the build. For example when you unlock an achievement the lock for the achievement should change to a checkmark, but it doesn't do that in the build for some reason.
Code for achievements
void Achievements()
{
PlayerPrefs.Save();
if(kills == 1)
{
achievement_1.transform.Find("Lock").gameObject.SetActive(false);
achievement_1.transform.Find("Checkmark").gameObject.SetActive(true);
Debug.Log("working");
}
if (kills == 50)
{
achievement_2.transform.Find("Lock (1)").gameObject.SetActive(false);
achievement_2.transform.Find("Checkmark (1)").gameObject.SetActive(true);
}
if (kills == 1000)
{
achievement_3.transform.Find("Lock (2)").gameObject.SetActive(false);
achievement_3.transform.Find("Checkmark (2)").gameObject.SetActive(true);
}
if (waveNum == 10)
{
achievement_4.transform.Find("Lock (3)").gameObject.SetActive(false);
achievement_4.transform.Find("Checkmark (3)").gameObject.SetActive(true);
}
if (waveNum == 50)
{
achievement_5.transform.Find("Lock (4)").gameObject.SetActive(false);
achievement_5.transform.Find("Checkmark (4)").gameObject.SetActive(true);
}
}
What bug are you referring to? There is no built-in achievement system. This looks like some janky poorly written achievement system you found in a tutorial.
I know there's no built in achievements system. $$anonymous$$y achievement system isn't working, I made the system. I came here because it's not working in the build. Do you have any suggestions on how I can fix that?
Answer by Mansmart10 · Feb 24, 2018 at 01:30 AM
Used PlayerPrefs to get the saved data of the kills and total wave number to get the achievements to work now.
Follow this Question
Related Questions
Slow unity things 0 Answers
Server build vs editor breaks clients 1 Answer
Do unused textures take up space in the final build? 1 Answer