---
title: "generateSphere(radius:)"
framework: realitykit
role: symbol
role_heading: Type Method
path: "realitykit/shaperesource/generatesphere(radius:)"
---

# generateSphere(radius:)

Creates a sphere shape with the specified radius.

## Declaration

```swift
@MainActor @preconcurrency static func generateSphere(radius: Float) -> ShapeResource
```

## Parameters

- `radius`: The radius of the sphere in meters.

## Return Value

Return Value The new sphere centered at the local origin.

## Discussion

Discussion note: Collision shape extents that fall below 2mm are forced to be 2mm in size - this includes, entities with negative scale values.
