Quick answer: Install the Bugnet Unity SDK, add a Button to your MainMenu canvas that calls Bugnet.OpenReportDialog() on click, and make sure the click handler captures a main menu screenshot along with device metadata. Players should be able to reach the button within two clicks of launching the game, and it should work without an active internet connection by queueing reports locally.
Bug reports you collect from your main menu are gold. They come from players who have already launched the game — meaning they care enough to keep trying — and they tend to be focused, not rage-submitted mid-death. A well-placed main menu bug report button can double your report volume without adding noise. Here’s how to add one to your Unity project cleanly, and the pitfalls to avoid.
Step 1: Install and Initialize the SDK
Grab the Bugnet Unity package from the Asset Store or install via Unity Package Manager using the Git URL. Add the Bugnet bootstrap component to a GameObject in your persistent scene — the one loaded before the main menu. A common pattern is a Bootstrap.unity scene that only contains your SDK initializers.
// Bootstrap.cs — runs before MainMenu loads
using UnityEngine;
using Bugnet;
public class Bootstrap : MonoBehaviour
{
[SerializeField] private string bugnetProjectKey;
void Awake()
{
DontDestroyOnLoad(gameObject);
BugnetSDK.Initialize(new BugnetConfig
{
ProjectKey = bugnetProjectKey,
CaptureUnityLogs = true,
QueueOfflineReports = true,
MaxQueuedReports = 50
});
}
}
Expose the project key as a SerializeField so you can set different keys for development and production builds. Never hardcode the key in a public repository. If you are using environment-specific configs, load the key from a ScriptableObject that is swapped per build target.
Step 2: Add the Button to Your Main Menu Canvas
Open your MainMenu scene and find the Canvas holding your menu buttons. Add a new Button element. You have two design choices: an icon-only button in the corner, or a text button listed alongside “Options” and “Credits”. Icon-only saves space but is slightly less discoverable. Text is clearer for players who haven’t seen a bug report icon before.
If you go with an icon, use a recognizable bug or speech bubble glyph and add a tooltip. Keep the button at around 40x40 pixels at 1080p so it’s tappable on touchscreens but not dominant. Position it bottom-right, above any copyright line.
For localization, remember that the button label needs to be translatable. If you use TextMeshPro, reference a localized string through Unity’s Localization package or your own string table. Don’t hardcode “Report a Bug” in the prefab.
Step 3: Handle the Click Event
Create a script that lives on the main menu and exposes a public method the Button can call via its OnClick inspector event. The handler captures a screenshot of the current menu, gathers device info, and calls into the Bugnet SDK to open the native report dialog.
// MainMenuBugReportButton.cs
using UnityEngine;
using UnityEngine.UI;
using Bugnet;
using System.Threading.Tasks;
[RequireComponent(typeof(Button))]
public class MainMenuBugReportButton : MonoBehaviour
{
[SerializeField] private Button reportButton;
void Awake()
{
if (reportButton == null) reportButton = GetComponent<Button>();
reportButton.onClick.AddListener(OnReportClicked);
}
async void OnReportClicked()
{
reportButton.interactable = false;
// Capture screenshot first so the menu looks normal in the attachment
var screenshot = await CaptureScreenshotAsync();
BugnetSDK.OpenReportDialog(new ReportContext
{
SourceScene = "MainMenu",
Screenshot = screenshot,
Metadata = new System.Collections.Generic.Dictionary<string, string>
{
{ "menu_version", Application.version },
{ "graphics_api", SystemInfo.graphicsDeviceType.ToString() },
{ "gpu", SystemInfo.graphicsDeviceName },
{ "os", SystemInfo.operatingSystem }
}
});
reportButton.interactable = true;
}
async Task<Texture2D> CaptureScreenshotAsync()
{
yield_to_end_of_frame: ;
await Task.Yield();
var tex = ScreenCapture.CaptureScreenshotAsTexture();
return tex;
}
}
The key detail is capturing the screenshot before the Bugnet dialog opens on top of the menu. If you grab it after the dialog is showing, the attachment will contain the dialog itself — useless for triage. ScreenCapture.CaptureScreenshotAsTexture runs synchronously after the next frame, which is why we yield once before capturing.
Testing the Flow End-to-End
The most common mistake is only testing this in the Unity editor. The editor doesn’t surface the same issues players hit in a production build: missing permissions on mobile, file paths that differ on console, IL2CPP stripping, and platform-specific screenshot APIs. Always test in a built player on each target platform before shipping.
Your test checklist should cover: submitting a report with no description (does it validate?), submitting with an attached screenshot larger than your upload size limit (does it downscale?), submitting while offline (does it queue?), and submitting from a cold launch before any gameplay (does it still initialize correctly?). Each of these has caught real bugs in production for studios we’ve worked with.
Also verify the IL2CPP build. Some SDKs that use reflection-based serialization break when IL2CPP strips unused code. Add a link.xml entry for the Bugnet assembly to preserve its types, and run a full build on iOS or a standalone platform that uses IL2CPP to catch this early.
Offline Queueing and Retry
Players on flaky Wi-Fi or in airplane mode still need to report bugs. The Bugnet SDK’s QueueOfflineReports option handles this automatically — it writes pending reports to Application.persistentDataPath and retries on the next launch. You don’t need to code this yourself, but you should test it.
To test offline queueing, enable Airplane Mode on your device, submit a report, check that the SDK confirms the submission was queued, then re-enable networking and relaunch the game. The queued report should upload within a few seconds of reconnect. Check your Bugnet dashboard to confirm it arrived with the correct timestamp (report creation time, not upload time).
Related Issues
If your bug report button calls throw null references, see Fix: Unity NullReferenceException on GetComponent. For button click issues in general, check Fix: Unity UI Button Not Responding to Clicks. If your build crashes before reaching the menu, see Fix: Unity Build Crashes on Android Device.
A bug report button in the main menu pays for itself on day one. Ship it.