I wanted to add an obstacle to the obstacle graph, and interestingly it gives me a runtime error. Is there something that I could be missing or doing that is causing an error?
Playground code
import GameplayKit
let graph = GKObstacleGraph()
let barrier = GKPolygonObstacle(points: [
float2(x: 200, y: 200),
float2(x: 500, y: 200)
])
graph.addObstacles([barrier]) // error: Playground execution aborted: error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0x20).
The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.