Skip to content

Commit 4154599

Browse files
authored
feat: Added Unity UserFeedback Prefab (#14667)
1 parent cef7e6e commit 4154599

File tree

3 files changed

+42
-7
lines changed

3 files changed

+42
-7
lines changed
555 KB
Loading
473 KB
Loading

docs/platforms/unity/user-feedback/index.mdx

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,56 @@ description: "Learn more about collecting user feedback when an event occurs. Se
55
sidebar_order: 6000
66
---
77

8-
When a user experiences an error, Sentry provides the ability to collect additional feedback. You can collect feedback according to the method supported by the SDK.
8+
<Alert level="info">
99

10-
## Use the .NET SDK
10+
The User Feedback Prefab is available in version `4.0.0` of the Sentry SDK for Unity, which is currently in beta.
1111

12-
<Alert>
12+
</Alert>
1313

14-
User Feedback for **[ASP.NET](/platforms/dotnet/guides/aspnet/user-feedback/#integration)** or **[ASP.NET Core](/platforms/dotnet/guides/aspnetcore/user-feedback/#integration)** supply integrations specific to supporting those SDKs.
14+
When a user experiences an error, Sentry provides the ability to collect additional feedback. The Unity SDK provides both a simple prefab-based solution and a programmatic API for collecting user feedback.
1515

16-
</Alert>
16+
## Use the User Feedback Prefab
17+
18+
The Unity SDK includes a ready-to-use prefab that provides a complete user feedback solution. This prefab contains:
19+
20+
- A feedback button (megaphone icon) that opens the feedback form
21+
- A feedback form with fields for:
22+
- Name (optional)
23+
- Email (optional)
24+
- Message/feedback (required)
25+
- Screenshot (optional, taken automatically)
26+
27+
### Adding the Prefab to Your Scene
28+
29+
To add the prefab, drag and drop the User Feedback prefab from the Unity SDK package into any scene. The prefab is ready to use immediately without any additional configuration, and includes a scaling canvas that works across different screen sizes and resolutions.
30+
31+
### Default Appearance
32+
33+
The User Feedback prefab includes a megaphone button that triggers the feedback form:
1734

18-
You can create a form to collect the user input in your preferred framework, and use the SDK's API to send the information to Sentry. You can also use the widget, as described below. If you'd prefer an alternative to the widget or do not have a web frontend, you can use this API:
35+
![Megaphone Button](./img/Megahpone.png)
36+
37+
When clicked, the feedback form appears with fields for user input:
38+
39+
![Feedback Form](./img/FeedbackForm.png)
40+
41+
### Customization
42+
43+
You can customize the feedback form by:
44+
45+
- Creating a prefab variant to inherit from the original while allowing updates
46+
- Removing optional fields (name, email) by deleting them from the VerticalLayoutGroup
47+
- Modifying the appearance and styling of the form elements
48+
- The prefab comes with a custom inspector that highlights missing or broken references:
49+
- Missing optional fields are highlighted in yellow
50+
- Missing required fields are highlighted in red
51+
52+
## Use the .NET SDK API
53+
54+
If you prefer to create your own feedback form or need programmatic control, you can use the SDK's API to send feedback to Sentry:
1955

2056
```csharp {tabTitle:C#}
2157
var eventId = SentrySdk.CaptureMessage("An event that will receive user feedback.");
2258

2359
SentrySdk.CaptureFeedback("It broke.", "[email protected]", "The User", associatedEventId: eventId);
2460
```
25-

0 commit comments

Comments
 (0)