Question

How can I make multiple Collision Rects with a single SKSpriteNode? Like I am trying to develop a concept in which some fruits are falling from sky and a basket has to collect them.

So when the fruits hit the side of the basket, it will have a physics-based reaction, like it will fall either right or left according to its mass and weight toward a certain direction. And when the fruits hit the center of the basket, it goes inside it or disappears. To do this I must have multiple Rects of physics around the SKSpriteNode. How can I achieve this?

Was it helpful?

Solution

Add SKNode as a child for each physicsBody you wish to add. Then add physicsBody to that node.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top