I have two objects that collide even when they are not moving, and are apart from each other.
Now I know it's rude not to include code. But before I start reducing my code to post it up here, at let me describe what's happening with a photo. Maybe I'll get lucky and it's something I'm overlooking since I am still learning.
Here are the two screenshots. I had to spilt the link because the forum won't let me post it completely.
https ://i.ibb.co/QYHcp3L/Untitled.png
In the left shot, everything you see, the two balls, and the left and bottom edges are created where you see them. The only thing I have not done is given the edges their SKPhysicsBodies. The edges purposes are just to keep the balls on screen. My intent is to keep the edges just a little off screen, but the same thing happens. I merely moved them in for the screenshots.
But in the right shot, I've just given the edges their physics bodies, isPinned is set to true for the edges and the masks are set so that ball and edge collide.
Yet for some reason, with nothing moving, the red ball collides with the bottom and left edges till it's pushed just off to the side.
This is all done under didMove. And I even tried not giving the edges their physics attributes till I tapped on the blank screen, and boom....everything suddenly collided.
If I have missed some sort of setting, would love to know. In the meantime, I'll start condensing all my code into one much smaller file.
Now I know it's rude not to include code. But before I start reducing my code to post it up here, at let me describe what's happening with a photo. Maybe I'll get lucky and it's something I'm overlooking since I am still learning.
Here are the two screenshots. I had to spilt the link because the forum won't let me post it completely.
https ://i.ibb.co/QYHcp3L/Untitled.png
In the left shot, everything you see, the two balls, and the left and bottom edges are created where you see them. The only thing I have not done is given the edges their SKPhysicsBodies. The edges purposes are just to keep the balls on screen. My intent is to keep the edges just a little off screen, but the same thing happens. I merely moved them in for the screenshots.
But in the right shot, I've just given the edges their physics bodies, isPinned is set to true for the edges and the masks are set so that ball and edge collide.
Yet for some reason, with nothing moving, the red ball collides with the bottom and left edges till it's pushed just off to the side.
This is all done under didMove. And I even tried not giving the edges their physics attributes till I tapped on the blank screen, and boom....everything suddenly collided.
If I have missed some sort of setting, would love to know. In the meantime, I'll start condensing all my code into one much smaller file.