This page explains how to install Game Rich Presence to your unity project.
To add Game Rich Presence to your unity project, simply follow this simple steps below:
- Use 2020.3.42f1 (or a newer), create a new project or use your existing project.
- Click Windows in the top bar, and then click Package Manager.
- From the Packages: drop-down menu, select My Assets.
- Enter Game Rich Presence in the search bar on the top right.
- Click Download.
- After downloading, click on Import.
- In the Import Unity Package window, click on Import again.
- Open the 1. Simple Rich Presence example scene, click Play and check your Discord status.
To display your game name and icons in Discord status, you need a Discord developer account. But don’t worry, creating a Discord developer account is very quick and easy.
Discord developer portal
- Open the Discord developer portal and log in if needed.
- Click New Application in the upper right corner and enter your game name.
- You don’t need to fill in the description or tags, just copy the APPLICATION ID by clicking Copy.
- Paste the APPLICATION ID into the Game Rich Presence Manager Prefab.
If you want to display icons in Discord status, you must first upload them in the Discord developer portal. It is important that all icons must have a minimum resolution of 512x512 pixels.
- Open your created application in the Discord developer portal.
- Click Rich Presence and then click Art Assets.
- Upload your icons (you have a limit of 300 icons).
- Give all icons a unique name, as you will use this name later in Unity to display them.
Make sure your Discord status is not invisible and that Show current activity status setting is enabled. You can find this setting in your Discord Settings under Activity Privacy.
Sometimes Unity does not load plugins correctly after importing, so restarting Unity helps here. This can also happen if you move the folder and Unity does not recognize it correctly.
The 2. Use Avatar as Texture example was created for the built-in rendering pipeline, but Unity provides an easy way to upgrade the material for your preferred rendering pipeline. Click “All Materials” select the following pink martaiels Floor, Wall and Transparent Material click in the top bar Edit > Rendering > Materials > Convert Selected. After the upgrade, all materials will look normal again.
Ensure that the Game Rich Presence Prefab is set up correctly, and that only one instance of the Game Rich Presence Manager is being used for the entire game. This instance will remain active even after changing scenes, as it is set to “DontDestroyOnLoad” in the hierarchy.
If you want update the Status while the game running or after a scene change, you can use the Singelton Instance of Game Richt Precense Manager Script. Here is a example code:
GameRichPresenceManagerScript.Instance.UpdateDetails("Dungon Run");
GameRichPresenceManagerScript.Instance.UpdateState("Playing Solo");
...