10.8 SKEffectNode() or Xcode 7 or my issue?


#1

I work in Xcode 7-beta 6 and with NSEffectNode() doesn’t work as it was suggested in the video.
Simply nothing happens when you use it. So if you use following code everything works fine:

let rocketPath = NSBundle.mainBundle().pathForResource("Rocket", ofType: "sks")!
let rocketFireEmitter = NSKeyedUnarchiver.unarchiveObjectWithFile(rocketPath) as! SKEmitterNode
rocketFireEmitter.position.y = rocketFireEmitter.position.y - 25
playerNode.addChild(rocketFireEmitter)

But if you use next one:

let rocketPath = NSBundle.mainBundle().pathForResource("Rocket", ofType: "sks")!
let rocketFireEmitter = NSKeyedUnarchiver.unarchiveObjectWithFile(rocketPath) as! SKEmitterNode
rocketFireEmitter.position.y = rocketFireEmitter.position.y - 25
//playerNode.addChild(rocketFireEmitter)

let firePathEffectMode = SKEffectNode()
firePathEffectMode.shouldEnableEffects = true
firePathEffectMode.blendMode = SKBlendMode.Screen
firePathEffectMode.addChild(rocketFireEmitter)
   
playerNode.addChild(firePathEffectMode)

so rocket fire is not coming on the screen at all!
What can I do with it?


#2

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.

Please test with this release, and update this report with your results. If you still have issues, please provide any relevant logs or information that could help us investigate.

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


#3

Hey,
This has not been fixed as of iOS 9 GM and OSX 10.11 GM.
Its very frustrating, is it working for you?


#4

Hi!
But you can use your real device for tracking changes.


#5

@crashoverride777 please submit a new bug report to apple and reference my bug number.

http://bugreport.apple.com

Bug ID 21509174: SKEffectNode doesn’t render on the iOS Simulator for Xcode 7 and Swift 2


#6

Hey Paul,
Thank you very much for your reply, I will submit a bug report now.
Is it working for you?
Are there any alternatives to achieve the same effect because right now I cannot do anything with my game?

Swift 2 and iOS 9 also messed up image atlases on iPads and Game Center banners in landscape mode. Very frustrating


#7

Does it work on a real device?

Did you google around to see if anyone else is running into issues with Image Atlases?

Try and submit bug reports for them.

Also, are you on Yosemite or El Capitan?


#8

Hey, thanks again for your reply. It does not work on either the simulator or the actual device. I am using iOS 9 GM, Xcode 7 GM and El Capitan GM
Yes I have been googling around and there are other people having the same issue with the image atlas too. For me it only happens on the first scene they are presented but enemies are about 3 times as big as they shoud be. If I change scene atlases are fine again, or if I change my deployment target from iOS 8 to iOS 9 than they are fine too


#9

Post bug reports about each issue to apple. That should help – on your theads/SO/Apple developer forum mention any bug report numbers that you’ve reported.


#10

This manifests on real devices for me. Xcode Version 7.0 (7A218) GM / iOS9 13A340.

As a workaround - you can add any kind of SKSpriteNode to the SKEffectNode alongside the SKEmitterNode. This fixed the issue for me.

My conspiracy theory guess is that they put some sort of optimisation in the effect node so that if it has no content on the first frame it disables it, and there is some sort of interaction with the particle system where it doesn’t render in time and then continues to not render because the parent node is disabled.

Whatever the case, the workaround is working for me in my current game.


#11

Hey thanks for your reply. Could you be slightly more specific with the SKSpriteNode that could fix it. I am actually just speaking to apple with a TSI. They are looking into it, i will keep you guys posted.


#12

Any SKSpriteNode should work. In my case I was painting a rocket trail, and I decided to add a glow at the base of the rocket, so I added an SKSpriteNode glow.png which is just a white circle blurred, with blend mode == .Add. If you wanted to work around but didn’t have a png image that you wanted to include you could try a single white pixel and set the z value so its underneath the particle effect.

Just add the SKSpriteNode and the SKEmitterNode so they’re both children of the SKEffectNode.