Search Unity

Help Wanted GameFoundation Can't be Initialized

Discussion in 'Game Foundation' started by Pepperoni92, Dec 4, 2019.

  1. Pepperoni92

    Pepperoni92

    Joined:
    Oct 26, 2014
    Posts:
    7
    Trying to incorporate GameFoundations into an existing project. Really like what the system promises to do.

    However, I cannot seem to get it initialized. When I try to initialize it in the Awake of one of my scene objects with GameFoundation.Initialize(), I receive a very vague warning in the console that say's:

    GameFoundation can't be initialized.
    UnityEngine.GameFoundation.GameFoundation:Initialize(IDataPersistence, Action, Action)


    Using Unity 2019.2.14f1 on MacOS
     
    Last edited: Dec 4, 2019
    erika_d likes this.
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,340
    Thanks for reporting this issue.
    • Would you be able to provide the script where you're calling GameFoundation.Initialize()?
    • Would you also be able to provide your gameFoundationDatabase?
    • Also, are trying to initialize using dataPersistence or not (although we should be able to get that info from the script)?
    One way we've been able to reproduce this issue is by not having the game foundation database set in the gamefoundationsettings. Could you confirm if that resolves the issue for you?

    We are working on improving the error message to give more information about the error and how to resolve it.
     
    Last edited: Dec 5, 2019
    erika_d likes this.
  3. Pepperoni92

    Pepperoni92

    Joined:
    Oct 26, 2014
    Posts:
    7
    I've just placed the script below on an empty GameObject in my scene. But, you can download a very simple version of the project that presents the same error at this link.

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.GameFoundation;
    3.  
    4. public class FoundationTest : MonoBehaviour
    5. {
    6.     private void Awake()
    7.     {
    8.         GameFoundation.Initialize();
    9.     }
    10. }
     
  4. erika_d

    erika_d

    Unity Technologies

    Joined:
    Jan 20, 2016
    Posts:
    316
    Hi @Pepperoni92,

    Are you still experiencing this issue? We tested with the project at the link you included above and weren't able to duplicate the issue. Can you double check that the GameFoundationSettings still has the GameFoundationDatabase linked as that's the easiest way to experience the error message you're getting. If it is linked, and you're still experiencing the issue, maybe you can create a support ticket by emailing game-foundation@unity3d.com so we can look into this in greater depth for you?
     
  5. Pepperoni92

    Pepperoni92

    Joined:
    Oct 26, 2014
    Posts:
    7
    Just tried it again in Unity 2019.2.15f1, and it seems to be working now. Perhaps something was fixed between versions.
     
    erika_d and mingz-unity like this.