---
title: "init(target:clippingPlane:)"
framework: realitykit
role: symbol
role_heading: Initializer
path: "realitykit/portalcomponent/init(target:clippingplane:)"
---

# init(target:clippingPlane:)

Creates a portal component with a target entity and a clipping plane.

## Declaration

```swift
init(target: Entity, clippingPlane: PortalComponent.ClippingPlane? = nil)
```

## Parameters

- `target`: A target world entity the portal is looking into.
- `clippingPlane`: A planar representation of a portal to enable the clipping feature. When nil, doc://com.apple.RealityKit/documentation/RealityKit/PortalComponent/clippingMode-swift.property is doc://com.apple.RealityKit/documentation/RealityKit/PortalComponent/ClippingMode-swift.enum/disabled.

## Discussion

Discussion This initializes the PortalComponent with the given target entity, and an optional clipping plane. The target entity needs a WorldComponent in its component set. To render a portal, an entity needs a PortalComponent and a ModelComponent, using one or more PortalMaterial instances. This initializer is equivalent to setting clippingMode with the same PortalComponent.Plane.
