Reputation:
when I try to use:
SKSpriteNode *player = [self childNodeWithName:@"player"];
"Incompatible pointer types initializing 'SKSpriteNode *' with an expression of type 'SKNode *'"
How do I fix that?? Thanks!
Upvotes: 1
Views: 628
Reputation:
You fix it by converting your variable from SKNode
to SKSpriteNode
. It's called Type Casting.
SKSpriteNode *player = (SKSpriteNode *)[self childNodeWithName:@"player"];
Upvotes: 4