I've seen a lot of these types of questions, but most of them were in Swift - also none of them seemed to have concrete answers. I am attempting to add a "worldNode" SKNode to a GameScene.sks file using the GUI editor. This node will be used as a basis for a "moving camera" I have added all child nodes of the scene to the worldNode (in the GUI editor) and my next step is to link it to my code implementation, this is where it stops working. I have tried to use this code:
SKNode *myWorld = [SKNode node];
SKNode *camera = [SKNode node];
camera.name = @"camera";
myWorld = [GameScene nodeWithFileNamed:@"worldNode"];
[self addChild:myWorld];
[myWorld addChild:camera];
The problem is from the line: myWorld = [GameScene nodeWithFileNamed:@"worldNode"];
This, from my understanding, should "tie" that worldNode from the GameScene.sks to my GameScene.m file, but when running I get the error: Attemped to add nil node
. I am basing the camera idea on the Advanced Scene Processing tutorial provided by Apple. I would like to be able to add all node in my GameScene.sks file to a main "worldNode" so I don't have to manually set up each level in code.