Hey, folks.
I was just informed that on some newer versions of Xcode and iOS, the GameScene is not loading, and instead shows a gray screen when attempting to run Val’s Revenge.
To fix this problem, you’ll need to add @objc(ComponentName)
to all GKComponent subclasses (e.g., @objc(HealthComponent)
, @objc(RenderComponent)
) to ensure compatibility with the Objective-C runtime and scene serialization.
Each GKComponent subclass in the SKS file must be marked with @objc because the Scene Editor serializes all components using NSKeyedArchiver. If one component lacks @objc, the entire scene may fail to load, resulting in a gray screen.
Older versions of Xcode will typically not have this issue.
- T
Example:
@objc(RenderComponent)
class RenderComponent: GKComponent {
.... the rest of your code