SKReferenceNode disappears in Xcode Scene Editor

I have a couple nodes that I have put into their own sks files so I can reuse them. I have a main level sks file that uses SKReferenceNode to include the other nodes. When I first open Xcode and open the container sks file the references show up fine. However, if I click on any other file and then come back to the container sks file then the reference nodes do not show up. They are just the empty SKReferenceNode icon.


Running the project has the same results. If I run it right after opening Xcode then the referenced nodes show up fine. If I open any other file and then build and run the project then the referenced nodes are totally missing.


Has anyone run into this? Am I setting up the scene incorrectly?


This is how it looks when it is working correctly: https://www.dropbox.com/s/ags040lf8wa8pin/SceneEditorBugCorrect.png?dl=0

This is how it looks when the nodes are missing: https://www.dropbox.com/s/c3ijwupn2oi055j/SceneEditorBugMissing.png?dl=0


I have tried this in Xcode 7.1 and Xcode 7.2 beta 4.


- Bridger Maxwell

This was bug driving me nuts, but I finally found a workaround.


When you create an .sks file to be used as a reference, the name of the texture used has to be different from the name of the .sks file or it won't show. I was using a reference to a file named gold.sks with an image named "gold" with a texture "gold" (from gold.png). The image wasn't showing in my scenes just like in your screenshot. I deleted the gold.png image and replaced it with gold-bar.png, and then used that new texture in the gold.sks file. The image now shows perfectly in all scenes it's used in as a reference.


I've tried this multiple times and it seems to always work.


I'm using Xcode 8.0 beta.

I can confirm this is still an issue, and that your workaround still applies, in the latest stable Xcode 8.2.1.

Odd bug. I've been using SKReferences a lot in Xcode 8. Seems fine, but then I don't think I ever named my SKReference the exact same name as an image file. Good to know. Thanks!

SKReferenceNode disappears in Xcode Scene Editor
 
 
Q