Has anyone else run into this error message? Class not decoded 'valsrevenge.HealthComponent'
I have seen this when trying to run the example finished in Ch. 16 provided by Tammy when trying to load GameScene_1 in the simulator, and also in my own project when trying to load any GameScene that is not GameScene_1
I have also noticed then in another project provided by Tammy with the PhysicsComponent
It looks like it can be solved with removing the custom components from the copied over scenes in your project. Then replace re-add them in the scene editor
This takes a while because you have to do this for the monsters and player nodes. If you don’t copy the .sks files over from the example project, it likely works fine
Hi, @jav-solo.
Sorry for the late reply. I was not notified about your comment. But I did receive an email from another reader who reported a similar problem yesterday: a gray screen when launching the game, which is due to the GameScene components failing to load.
Technically, you could add the module name (valsrevenge) in the SKS file, but that doesn’t always solve the problem. A better solution is to add @objc(HealthComponent) — you’ll actually need to add this code to all of the components, swapping out the GKComponent name. For example: @objc(RenderComponent).
This behavior is tied to how GameplayKit and SpriteKit interact with the Objective-C runtime and scene serialization in .sks files. I can provide a more in-depth answer/response if needed.
Again, sorry for the late reply!