Unreal Engine
Configure Sentry with Unreal Engine.
Warning
This SDK is a preview that packages Sentry's native SDKs into an Unreal Engine plugin. Alternatively, the stable Crash Reporter tool provided by Epic Games can be used in order to capture and alert of errors from your game.
Features:
- Native support for automatic crash error tracking for
- Android by using the Android SDK to support Java, Kotlin, C and C++
- iOS by using the iOS SDK to support Objective-C, Swift, C and C++
- Windows and Linux by using the Native SDK to support C and C++ with minidumps
- macOS by using the macOS SDK to support Objective-C, Swift, C and C++
- Compatible with Unreal Engine 5
- Crash Reporter Client provided along with Unreal Engine
Crash Reporter Client has to be configured in order to capture crashes on Windows automatically. This step isn't required starting with UE 5.2 because the engine provides an API, which allows you to switch between default and third-party crash-handling solutions.
On this page, we get you up and running with Sentry's SDK, so that it will automatically report errors and exceptions in your application.
Don't already have an account and Sentry project established? Head over to sentry.io, then return to this page.
Install
Sentry captures data by using an SDK within your application’s runtime.
The Unreal Engine (UE) SDK is currently compatible with UE 4.27 or later and supports Windows, Linux, macOS, iOS, and Android.
To build the SDK, download the latest sources from the Releases page and place it in the project's Plugins
directory. On the next project launch, UE will prompt to build Sentry module.
Currently, this method is available only for C++ UE projects. Blueprint projects can be converted to a C++ one by adding an empty class using the editor.
After the successful build, in the editor navigate to the Settings > Plugins > Code Plugins menu and check whether the Sentry plugin is enabled:
To access the plugin API from within C++,
add Sentry
support to the build script (MyProject.build.cs
):
PublicDependencyModuleNames.AddRange(new string[] { ..., "Sentry" });
Configure
The minimum configuration required is the DSN of your project:
https://examplePublicKey@o0.ingest.sentry.io/0
If you are logged in, you can also go to your project settings and copy its DSN directly from there.
Sentry can be configured using the Sentry configuration window. The window can be accessed by going to editor's menu: Project Settings > Plugins > Sentry.
Alternatively, the Initialize SDK automatically
option can be enabled in order to initialize the SDK on application startup. In this case, explicit SDK initialization won't be required.
To override SDK settings at runtime, use the InitializeWithSettings
method of the SentrySubsystem
class.
Verify
This snippet includes message capturing, so you can test that everything is working as soon as you set it up:
#include "SentrySubsystem.h"
void Verify()
{
// Obtain reference to GameInstance
UGameInstance* GameInstance = ...;
// Capture message
USentrySubsystem* SentrySubsystem = GameInstance->GetSubsystem<USentrySubsystem>();
SentrySubsystem->CaptureMessage(TEXT("Capture message"));
}
The same result can be achieved by calling corresponding function in blueprint:
Learn more about manually capturing an error or message in our Usage documentation.
To view and resolve the recorded error, log into sentry.io and open your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved.
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) to suggesting an update ("yeah, this would be better").
- Package:
- github:getsentry/sentry-unreal
- Version:
- 0.7.0
- Repository:
- https://github.com/getsentry/sentry-unreal