HackingWithSwift icon indicating copy to clipboard operation
HackingWithSwift copied to clipboard

Project 36 PhysicsBody: Could not create physics body on createPlayer()

Open mirchaemanuel opened this issue 5 years ago • 0 comments

iOS 13.7 (SE 2nd simulator) Xcode Version 11.7 (11E801a) Swift: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)

Console output:

2020-09-08 23:05:24.019709+0200 Project36[66680:2549632] Metal GPU Frame Capture Enabled
2020-09-08 23:05:24.020347+0200 Project36[66680:2549632] Metal API Validation Enabled
2020-09-08 23:05:24.153016+0200 Project36[66680:2549632] PhysicsBody: Could not create physics body.

error on unwrapping nil on line 86:

		player.physicsBody!.contactTestBitMask = player.physicsBody!.collisionBitMask

player.phisicsBody is nil

mirchaemanuel avatar Sep 08 '20 21:09 mirchaemanuel