Swift, SpriteKit, iOS.
I have an infinitely scrolling background and a character ‘walking’ on the ground plane.
I want to drop objects from above and have them land on the ground - so far so good. But the objects don’t move with the ground.
Can’t find any examples where this is taken care of.
my ‘ground’ is just an edge at the correct height with regard to my graphics background.
let Edge = SKNode() Edge.physicsBody = SKPhysicsBody(edgeFromPoint: CGPointZero, toPoint: CGPointMake(self.frame.width + 1, 0)) Edge.position = CGPointMake(0, bottomShelf_ItemStartPosition.y) self.addChild(Edge)
I’ve tried giving my ground SKSriteNode physical properties, but this didn’t make any difference.
What would be the best approach for this ? Must be a simple way to make the moving ground affect objects ??
thanks for any advice.