0

I'm trying to adjust some effects but I need to use SKEffectNode(), so I wrote the following code:

let rocketPath = NSBundle.mainBundle().pathForResource("Rocket", ofType: "sks")!
    let rocketFireEmitter = NSKeyedUnarchiver.unarchiveObjectWithFile(rocketPath) as! SKEmitterNode

    //playerNode.addChild(rocketFireEmitter)  // #1

    let firePathEffectMode = SKEffectNode()
    firePathEffectMode.shouldEnableEffects = true
    firePathEffectMode.addChild(rocketFireEmitter)

    playerNode.addChild(firePathEffectMode)   // #2

If I use the code identified as #1 - which I commented out - everything works just fine. But I need to use some effects, so I wrote instead the code block between #1 and #2. I can't see my rocket fire but neither do I receive any error.

I can't find the problem; I tried changing zPosition but to no avail.

I'm using Xcode 7 beta 6. Thanks guys!

MustangXY
  • 358
  • 2
  • 16
wm.p1us
  • 2,019
  • 2
  • 27
  • 38

1 Answers1

1

I submitted a bug report to Apple about this bug.

They're saying the latest version of the beta version of El Capitan fixes the issue for the iOS Simulator. However, I don't recommend beta versions of Mac OS X right now.

The work around is to run this on your iPhone, not the iOS Simulator. It should work on a real device.

Follow-Up: Bug ID 21509174: SKEffectNode doesn't render on the iOS Simulator for Xcode 7 and Swift 2

We believe this issue has been addressed in the latest OS X El Capitan 10.11 update (build 15A263e). This is a pre-release OS X update. Please refer to the release notes for complete installation instructions.

OS X Yosemite 10.11 - Developer beta https://developer.apple.com/devcenter/mac/index.action

Paul Solt
  • 8,375
  • 5
  • 41
  • 46
  • There may be a workaround of adding another SKNode or SKSpriteNode to the SKEffectNode children. I haven't tried it yet, but someone emailed me about it. – Paul Solt Sep 29 '15 at 17:25