I have created a custom class called ScoreBoardScene that inherits from SCNScene. in the .m file I have a method that adds all the geometry to the scene called -(void)createScene. Now where do I call createScene? Like is there a certain init method? Also according to this tutorial I need to have a nscoder method as well. So what are the two methods I need to complete the sceneview class besides all the custom methods I have?
Asked
Active
Viewed 445 times
1 Answers
2
Don't subclass SCNScene
.
- Trouble subclassing SCNScene
- Subclassing SCNScene and SceneKit Editor
- Subclassing SCNScene in Swift - override init
Instead, your createScene
method (perhaps implemented in an Objective-C category on SCNNode
) should return an SCNNode
which is the root node of your scene.
For even better startup performance, you can run createScene
once, in an auxiliary program, and then archive the scene. The archived scene can then be embedded as a resource in your final product, and even tweaked using the SceneKit editor in Xcode..

Community
- 1
- 1

Hal Mueller
- 7,019
- 2
- 24
- 42