J
J
John2017-02-15 16:20:17
Swift
John, 2017-02-15 16:20:17

How to create physics for the whole map in SpriteKit?

If this is how we take our scene layer and create physics for it

self.ground = self.childNode(withName: "//Ground") as! SKTileMapNode
self.ground.physicsBody = SKPhysicsBody(texture: self.texture, size: self.ground.tileSize)

then it turns out that the physics is created in the image of our texture, but not in the image of the entire map
d0e1ba4216334aacb381f6cb3cb7bfd0.jpg
Question: How to create a physical body for the entire layer at once ???

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question