How can you add a custom component to SKNodes on a project with one target with watchOS?
Asked
Active
Viewed 52 times
-1

Maetschl
- 1,330
- 14
- 23

Adrian Plapamaru
- 21
- 1
-
2Welcome to stackoverflow. Please have a look at other good/popular questions in order to get a grasp about how a good question should look like. Also, https://stackoverflow.com/help/how-to-ask may guide you in writing a clear and concise question that can be answered. In the current state, your question most likely won't be answered. – pdu Mar 04 '20 at 13:37
1 Answers
1
You only can add custom components, creating a new class extended a GKComponent
for example:
import GameplayKit
class NewGameComponent: GKComponent {
}
Then you can see the component in the list like this:
You can download an example here: https://github.com/Maetschl/SpriteKitExamples/tree/master/ComponentTest
The WatchOS target are not related to the question.

Maetschl
- 1,330
- 14
- 23
-
1Thank you for your help! The WatchOS target is related to my question because my project is for watch. The Watch OS doesn’t have GameplayKit library. The GameplayKit is only available for iOS, macOS, Mac Catalyst and tvOS. So, I can not use GKComponent. So my questions stands: What kind of component can be added on watch os if GKComponent can not be use. – Adrian Plapamaru Mar 05 '20 at 13:33
-