question

nucleatnt avatar image
nucleatnt asked

Start Function Not Calling?

My code was working fine yesterday, I could put in my email etc and playerprefs could log me in faster blah blah blah but now my start function isn't calling at all. I've made sure I have the script attached to a gameobject and the script is enabled, but it still refuses to work!

public void Start()
    {
        Debug.Log("Started");
        Time.timeScale = 0f;
        //Note: Setting title Id here can be skipped if you have set the value in Editor Extensions already.
        if (string.IsNullOrEmpty(PlayFabSettings.TitleId))
        {
            PlayFabSettings.TitleId = "my title id would be here but idk if its safe to share"; // Please change this value to your own titleId from PlayFab Game Manager
        }
        //var request = new LoginWithCustomIDRequest { CustomId = "GettingStartedGuide", CreateAccount = true };
        //PlayFabClientAPI.LoginWithCustomID(request, OnLoginSuccess, OnLoginFailure);
        if (PlayerPrefs.HasKey("EMAIL"))
        {
            userEmail = PlayerPrefs.GetString("EMAIL");
            userPassword = PlayerPrefs.GetString("PASSWORD");
            var request = new LoginWithEmailAddressRequest { Email = userEmail, Password = userPassword };
            PlayFabClientAPI.LoginWithEmailAddress(request, OnLoginSuccess, OnLoginFailure);
        }
    }
unity3d
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mattdavidson2017 avatar image mattdavidson2017 commented ·

Does the class extend monobehaviour?

0 Likes 0 ·

1 Answer

nucleatnt avatar image
nucleatnt answered

Ah sorry I didn't realise this was still open. I fixed the issue, a piece of code was going rogue and destroying the instance before it could run start(). How do I close this question?

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Citrus Yan avatar image Citrus Yan commented ·

Glad you figure it out, we'll close the question for you:)

0 Likes 0 ·