Search code examples
c#unity-game-enginediscord

Discord SDK Terminates Unity Editor when Discord is not running


This question doesn't really contain any code...

I Added the Discord SDK to my project and every time I run the game, it Closes the Unity Editor. Is there a way to stop the Discord SDK from terminating the Editor?


Solution

  • @EliasV you need Discord app running when trying to launch the game in Editor.

    /*
        Grab that Client ID from earlier
        Discord.CreateFlags.Default will require Discord to be running for the game to work
        If Discord is not running, it will:
        1. Close your game
        2. Open Discord
        3. Attempt to re-open your game
        Step 3 will fail when running directly from the Unity editor
        Therefore, always keep Discord running during tests, or use Discord.CreateFlags.NoRequireDiscord
    */
    

    https://discord.com/developers/docs/game-sdk/sdk-starter-guide