The Panel Input Configuration component provides properties to configure the input settings for the World Space UI, and to specify how UI Toolkit interacts with uGUI (Unity UI).
The following table describes the properties available for World Space Options:
Property | Description |
---|---|
Interaction Layers | Select one or more Physics layers to cast World Space rays and determine pointer event targets. |
Max Interaction Distance | Set how far away interactions with World Space UI are possible. Defaults to unlimited (infinity), but you can customize it for XRAn umbrella term encompassing Virtual Reality (VR), Augmented Reality (AR) and Mixed Reality (MR) applications. Devices supporting these forms of interactive applications can be referred to as XR devices. More info See in Glossary or performance needs. The distance uses GameObjectThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info See in Glossary units, consistent with transform positions and CameraA component which creates an image of a particular viewpoint in your scene. The output is either drawn to the screen or captured as a texture. More info See in Glossary clipping planesA plane that limits how far or close a camera can see from its current position. A camera’s viewable range is between the far and near clipping planes. See far clipping plane and near clipping plane. More info See in Glossary. |
Default Event Camera Is Main Camera | Enable or disable the use of the main camera as the event camera to transform screen positions into World Space rays. If enabled and the main camera changes, the event camera automatically updates to the new camera. If no main camera is active, Unity disables screen-based events until a main camera becomes active. |
Event Cameras | Set one or more cameras to transform screen positions into World Space rays when the main camera isn’t used. If you specify multiple cameras, Unity processes them sequentially until one produces a ray that hits a Collider. Note: If you don’t specify any event cameras, Unity disables screen-based events. |
You can use the Event SystemA way of sending events to objects in the application based on input, be it keyboard, mouse, touch, or custom input. The Event System consists of a few components that work together to send events. More info
See in Glossary Interaction properties to configure how the UI Toolkit interacts with the uGUI system.
The Panel Input Redirection property determines whether the uGUI EventSystem redirects panel input. If enabled, you can choose from the following options:
The Auto Create Panel Components property determines whether to automatically create UI Toolkit components under the EventSystem to handle input redirection between UI Toolkit and uGUI panels.
If you enable this option, Unity automatically creates the following components:
If you disable this option, ensure to assign a World Document Raycaster component for each World Space event camera. You must also ensure that each panel has an associated Panel Raycaster and Panel Event Handler component through your C# code. The following code example shows how to do this:
using UnityEngine.UIElements;
// Add this component to a GameObject to automatically initialize the following components
// - PanelRaycaster
// - PanelEventHandler
public class PanelComponentsInitializer : MonoBehaviour
{
public PanelSettings panelSettings;
void Start()
{
var panelRaycaster = GetComponent<PanelRaycaster>();
if (panelRaycaster != null)
panelRaycaster.panel = panelSettings.panel;
var panelEventHandler = GetComponent<PanelEventHandler>();
if (panelEventHandler != null)
panelEventHandler.panel = panelSettings.panel;
}
}
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.