Accessibility means designing experiences that people with disabilities can use. This includes people who rely on assistive technologies such as screen readers, as well as those who use system settings such as large text or closed captions. For background on disability categories, assistive technologies, and why accessibility matters, refer to Accessibility concepts.
The Unity Accessibility module enables games and applications to communicate with native screen readers and respond to the system accessibility settings on the user’s device. This module helps you transform visual interfaces into experiences that everyone can use.
The Accessibility module is enabled by default. If it is not enabled in your project, you can enable it through the Package Manager.
The major mobile and desktop operating systems have built-in screen readers.
The following table lists the platforms and screen readers that the Accessibility module supports:
| Platform | Screen reader |
|---|---|
| Android | TalkBack |
| iOS | VoiceOver |
| Windows | Narrator |
| macOS | VoiceOver |
You create accessibility metadata that screen readers understand, and the module handles the platform-specific translation automatically.
The Accessibility module enables you to:
Note: Because the Accessibility module uses native APIs, the expected behavior of the module’s APIs depends on the platform, operating system version, and screen reader. Always test your application with the target screen readers.
The Accessibility module has the following limitations:
VisualElement class. You can style the look, define the behaviour, and display it on screen as part of the UI. More infoUse the AssistiveSupport API to enable screen reader support for your application. This class stores the accessibility hierarchy that you create, allows your application to notify the screen reader of changes in your UI, and notifies your application of events based on user actions.
The Accessibility module uses a node-based AccessibilityHierarchy separate from the GameObject hierarchy. You create AccessibilityNode instances that represent visual elements in your UI and game world. Each node has properties that define its label, value, role, state, and relationships to other nodes.
Your active Unity scene (visual) AssistiveSupport (semantic)
└── Canvas (uGUI) / UI Document (UI Toolkit) └── AccessibilityHierarchy
└── Button └── AccessibilityNode
└── Text: "Start Game" ├── Label: "Start Game"
└── Role: Button
You can use the Accessibility Hierarchy Viewer (menu: Window > Accessibility > Accessibility Hierarchy Viewer) during Play mode to view your active accessibility hierarchy in real-time.
When you set a node’s role, the Accessibility module translates it to the corresponding native API:
| Platform | Native API | Native node representation |
|---|---|---|
| Android | android.view.accessibility |
AccessibilityNodeInfo with className = "android.widget.Button"
|
| iOS | UIAccessibility |
UIAccessibilityElement with accessibilityTraits = UIAccessibilityTraitButton
|
| Windows | UI Automation |
IRawElementProviderSimple with ControlType = UIA_ButtonControlTypeId
|
| macOS | NSAccessibility |
NSAccessibilityElement with accessibilityRole = NSAccessibilityButtonRole
|
The following diagram illustrates the flow of events between a screen reader user, the operating system, Unity’s Accessibility module, and your application when a user interacts with an accessible button in your UI:
The user activates the button with the screen reader
→ The operating system sends the activation event to Unity
→ Unity translates the event to AccessibilityNode.invoked
→ Your event handler invokes the click event on the button
→ The button responds normally
The Accessibility module supports many common UI elements, including the following elements with their expected properties and events:
| Element | Role | Properties and events |
|---|---|---|
| Button | AccessibilityRole.Button |
AccessibilityNode.invoked |
| Slider | AccessibilityRole.Slider |
AccessibilityNode.value, AccessibilityNode.incremented, AccessibilityNode.decremented
|
| ToggleA checkbox that allows the user to switch an option on or off. More info See in Glossary |
AccessibilityRole.Toggle |
AccessibilityState.Selected, AccessibilityState.None
|
| Text input | AccessibilityRole.TextField |
AccessibilityNode.value |
| Dropdown | AccessibilityRole.Dropdown |
AccessibilityNode.value, AccessibilityState.Expanded, AccessibilityState.None, and child nodes for options |
Use the AccessibilitySettings API to retrieve and listen to updates in the native font scaling, bold text, and closed captions settings on the user’s device, and adjust your UI and game experience accordingly. This improves usability for people with low vision, hearing impairments, and cognitive disabilities, as well as users in noisy or silent environments or those whose first language differs from the language of your game or application.
The accessibility settings APIs are available for Android and iOS.