Safe Area is a Unity UGUI package that fits a target RectTransform to the current device safe area. It is useful for keeping UI away from notches, rounded corners, and system gesture areas.
- open
Edit/Project Settings/Package Manager - add a new Scoped Registry:
Name: OpenUPM URL: https://package.openupm.com/ Scope(s): com.mrvc - click Save
- open Package Manager
- click +
- select Add from Git URL
- paste
com.mrvc.safearea - click Add
- Add
CanvasHelperto the same GameObject as yourCanvas. - Assign the
RectTransformthat should stay inside the safe area. - Choose which edges should respect the safe area.
- Optionally select a preview device in the custom inspector while working in the editor.