Referencing Scene Builder nodes in code

Hi Everyone!

I have been wondering what the actual proper way of connecting to your code nodes that you have added in the SpriteKit scene builder?

I know that you can do with with the following code…

var node = SKSpriteNode()

node = self.childNode(withName : “Whatever you named it in Scenebuilder”) as! SKSpriteNode

This works but it seems like it is not the correct way to reference nodes you have added in the scenebuilder…

Thanks for any input!

@vanlawler Please check out the following tutorial when you get a chance:

Thank you! :]

1 Like

Thanks for the reply @shogunkaramazov!

I will check it out! I’m not really sure how I missed that one :thinking:.

This topic was automatically closed after 166 days. New replies are no longer allowed.