---
title: "generate(friction:restitution:)"
framework: realitykit
role: symbol
role_heading: Type Method
path: "realitykit/physicsmaterialresource/generate(friction:restitution:)"
---

# generate(friction:restitution:)

Generates a new material with the given characteristics.

## Declaration

```swift
@MainActor @preconcurrency static func generate(friction: Float = 0.8, restitution: Float = 0.8) -> PhysicsMaterialResource
```

## Parameters

- `friction`: The coefficient of friction, in the range [0, infinity).
- `restitution`: The coefficient of restitution, in the range [0, 1]. Use values at the high end of the range to indicate materials that experience elastic collisions, meaning that objects bounce off each other and kinetic energy is conserved after a collision. Use low values to indicate materials that lose kinetic energy when they collide.

## Return Value

Return Value A physics material resource.

## See Also

### Creating a custom material resource

- [generate(staticFriction:dynamicFriction:restitution:)](realitykit/physicsmaterialresource/generate(staticfriction:dynamicfriction:restitution:).md)
