wm.p1us
wm.p1us

Reputation: 2059

can't see SKEffectNode as a child with suggested effects

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!

Upvotes: 0

Views: 109

Answers (1)

Paul Solt
Paul Solt

Reputation: 8395

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

Upvotes: 1

Related Questions