<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/PortalComponent/makePortal(surfaceStyle:boundaryStyle:boundaryMode:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation15PortalComponentV04makeC012surfaceStyle08boundaryG00H4ModeAC0C0VAC07SurfaceG0V_AC08BoundaryG0VAC0kI0OtFZ"
  },
  "title" : "makePortal(surfaceStyle:boundaryStyle:boundaryMode:)"
}
-->

# makePortal(surfaceStyle:boundaryStyle:boundaryMode:)

Creates a portal entity and a world entity, and configures them.

```
static func makePortal(surfaceStyle: PortalComponent.SurfaceStyle, boundaryStyle: PortalComponent.BoundaryStyle = .infinitePlane(), boundaryMode: PortalComponent.BoundaryMode = .none) -> PortalComponent.Portal
```

## Parameters

`surfaceStyle`

The size of the portal surface mesh.

`boundaryStyle`

The shape of the clipping and crossing boundary. Defaults to
[`infinitePlane()`](/documentation/RealityKit/PortalComponent/BoundaryStyle/infinitePlane()).

`boundaryMode`

The combination of clipping and crossing behaviors to enable. Defaults
to [`PortalComponent.BoundaryMode.none`](/documentation/RealityKit/PortalComponent/BoundaryMode/none).

## Return Value

A [`PortalComponent.Portal`](/documentation/RealityKit/PortalComponent/Portal) containing the new portal entity and world entity.

## Discussion

This is the simplest way to set up a portal. The returned [`PortalComponent.Portal`](/documentation/RealityKit/PortalComponent/Portal) value contains a fresh
portal entity and a fresh world entity that you add to your scene. To add portal world
content, parent it under the returned `worldEntity`.

```swift
let portal = PortalComponent.makePortal(
    surfaceStyle: .init(width: 0.5, height: 0.5),
    boundaryStyle: .infinitePlane(),
    boundaryMode: .clippingAndCrossing
)

content.add(portal.worldEntity)
content.add(portal.portalEntity)
```

To configure entities you already own — for example, a portal entity that has gesture
components, or a world entity that’s already in your scene hierarchy — use
[`configure(world:portalEntity:surfaceStyle:boundaryStyle:boundaryMode:)`](/documentation/RealityKit/PortalComponent/configure(world:portalEntity:surfaceStyle:boundaryStyle:boundaryMode:)) instead.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)