# autoCreatePanelComponents

> When enabled, automatically creates child GameObjects with raycaster and event handler components attached to uGUI's EventSystem.

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine.UIElements](/engine/6000.7/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

```csharp
public bool autoCreatePanelComponents { get; set; }
```

### Remarks

If this option is enabled, for each panel that uses the screen space overlay render mode, one child GameObject is created with a PanelRaycaster and PanelEventHandler components associated to it.

If the [\_defaultEventCameraIsMainCamera](/engine/6000.7/script-reference/unityengine/uielements/panelinputconfiguration/defaulteventcameraismaincamera.md) option is enabled, Unity automatically adds one WorldDocumentRaycaster to handle inputs for world-space UI. When created automatically, the WorldDocumentRaycaster's Event Camera is not assigned. Instead, it automatically detects and uses the Main Camera in the Scene as the source for input. Otherwise, for each Camera in the [\_eventCameras](/engine/6000.7/script-reference/unityengine/uielements/panelinputconfiguration/eventcameras.md) list, a distinct WorldDocumentRaycaster component is created and its Event Camera property is assigned to that Camera.

If this option is disabled, UI Toolkit events are disabled unless you manually add raycaster and event handler components to the scene manually and initialize them accordingly.

This property has no effect in the following situations:

* If there is no active EventSystem.

* If the \_panelInputRedirection option is set to not interact with the EventSystem.
