sentry-unity icon indicating copy to clipboard operation
sentry-unity copied to clipboard

feat: User Feedback

Open bitsandfoxes opened this issue 4 months ago • 4 comments
trafficstars

Fixes https://github.com/getsentry/sentry-unity/issues/928

Goal

The idea is to provide users a simple to use prefab to add to their game to allow players to provide user feedback. This is a first iteration and the things we're looking to have added to the feedback is:

  • Name (optional)
  • Email (optional)
  • A message - i.e. feedback (required)
  • Screenshot (optional)

How it's done

A prefab that holds a GameObject with a scaling canvas that can be dropped into any scene. The prefab consists of two parts:

  1. The button to pop up the form
  2. The form to submit the feedback
Screenshot 2025-06-27 at 13 18 46

They are both part of the same prefab as it make little sense to provide them separately to customize them. If you were to customize one we'd need a way to provide the other one a reference which would be a pita to support.

How to allow for customization

The prefab can be dragged into the /Assets allowing for the creation of a prefab variant. This variant "inherits" from the original and all values that have not been explicitly changed will get updated.

Adding to the scene

Adding the User Feedback to the scene can be done via drag&drop:

https://github.com/user-attachments/assets/ee43982f-8adb-472a-903b-2ce7ea903e05

In Action

Clicking the megaphone button pops up the form to submit user feedback.

https://github.com/user-attachments/assets/8b114262-8a0c-483d-b21a-c885930e65b3

Since the canvas scales with the screen, this should work on a very wide range of displays and resolutions, i.e. mobile

Screenshot 2025-06-27 at 13 18 08

When submitting the report we're delaying to send it to the EndOfFrame so the screenshot does not contain the form.

Screenshot 2025-06-27 at 13 18 08

Custom Inspector - A defensive approach

We're handing users a prefab with its own SentryUserFeedbackMonoBehaviour. We need to be defensive about how it's going to be used. That's why it comes with it's own custom inspector to highlight broken or missing references

Screenshot 2025-06-27 at 13 19 07

TODO:

Fix the commented ScreenshotEventProcessor tests

bitsandfoxes avatar Jun 26 '25 16:06 bitsandfoxes