I just set up a boundary for my game which seems to be working alright until it is really forced, as in I make my character run towards it for several seconds, and then my character will just go straight through. Any explanations for this and how I can fix it?
edit: here is the code for my boundary
func createSceneContents() {
self.backgroundColor = .black
self.physicsBody = SKPhysicsBody(edgeLoopFrom: self.frame)
}
createSceneContents()
ship.physicsBody = SKPhysicsBody(rectangleOf: ship.size)
ship.physicsBody?.affectedByGravity = false
ship.physicsBody?.isDynamic = true
ship.name = "ship"
ship.physicsBody?.categoryBitMask = PhysicsCategory.ship
ship.physicsBody?.collisionBitMask = PhysicsCategory.ship