0

for some reason, whenever i win the game, that is the player hits the target, the app crashes at line
playerPhysicsBody.node?.addChild(emitter!)
with an error fatal error: unexpectedly found nil while unwrapping an Optional value any help here please?

rmaddy
  • 307,833
  • 40
  • 508
  • 550

1 Answers1

0

Before Execute Check Whether Is Null Or Not.

    if(playerPhysicsBody != nil){
          playerPhysicsBody.node?.addChild(emitter!)
    }