import SpriteKit
public class GameScene: SKView {
public override func didMove(view: SKView) {
physicsBody = SKPhysicsBody(edgeLoopFrom: frame)
}
}
Showing Error in didMove func and physicsBody.
Have any of you ever had issues like that?
Or maybe you just know what’s going on and how to fix it?
public class GameScene: SKView {
public override func didMove(view: SKView) {
physicsBody = SKPhysicsBody(edgeLoopFrom: frame)
}
}
Showing Error in didMove func and physicsBody.
Have any of you ever had issues like that?
Or maybe you just know what’s going on and how to fix it?
What sort of error do you get? Please show more context.Showing Error in didMove func and physicsBody.
But assuming you are using the code shown as is, the code would never run or would never have run in any versions of Xcode Playgrounds. It is not a valid code in Swift.
SKView does not have a method didMove(view:), you cannot override non-existing method.
SKView (or your GameScene) does not have a property named physicsBody, you cannot assign something to non-existing property.
Code Block public class GameScene: SKScene { public override func didMove(to view: SKView) { physicsBody = SKPhysicsBody(edgeLoopFrom: frame) } }