---
title: "init(edgeFrom:to:)"
framework: spritekit
role: symbol
role_heading: Initializer
path: "spritekit/skphysicsbody/init(edgefrom:to:)"
---

# init(edgeFrom:to:)

Creates an edge between two points.

## Declaration

```swift
init(edgeFrom p1: CGPoint, to p2: CGPoint)
```

## Parameters

- `p1`: The starting point for the edge, relative to the owning node’s origin.
- `p2`: The ending point for the edge, relative to the owning node’s origin.

## Mentioned in

Shaping a Physics Body to Match a Node’s Graphics

## Return Value

Return Value A new edge-based physics body.

## Discussion

Discussion An edge has no volume or mass and is always treated as if the isDynamic property is equal to false. Edges may only collide with volume-based physics bodies.

## See Also

### Creating an Edge-Based Physics Body

- [Creating an Edge Loop Around a Scene](spritekit/creating-an-edge-loop-around-a-scene.md)
- [init(edgeLoopFrom:)](spritekit/skphysicsbody/init(edgeloopfrom:)-8sqfy.md)
- [init(edgeLoopFrom:)](spritekit/skphysicsbody/init(edgeloopfrom:)-5grxu.md)
- [init(edgeChainFrom:)](spritekit/skphysicsbody/init(edgechainfrom:).md)
