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

# generateSphere(radius:)

Creates a new sphere mesh with the specified radius.

## Declaration

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

## Parameters

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

## Return Value

Return Value A sphere mesh.

## Discussion

Discussion The sphere is centered at the entity’s origin.

## See Also

### Creating a primitive shape

- [generateCone(height:radius:)](realitykit/meshresource/generatecone(height:radius:).md)
- [generateCylinder(height:radius:)](realitykit/meshresource/generatecylinder(height:radius:).md)
