0

I am making a mini-golf like course where a ball is bounded by walls. The ball and the walls are basic SKNodes with physics bodies. At high speeds, the ball bounces off each wall correctly. However, when the ball is below a certain velocity, the ball will stick to the wall.

A question like this was asked at SpriteKit Nodes Sticking to Edges of Scene / Not Bouncing but none of the answers seem to solve my problem. Taken from that post is a good picture of what is happening:

https://i.stack.imgur.com/fJigh.png

My nodes have a friction of 0, linear damp of 0, angular damp of 0, and restitution of 1. I have played around with all these numbers, but can't seem to solve the issue. Any help would be greatly appreciated!

Community
  • 1
  • 1
mjfish93
  • 95
  • 8
  • Is there any sort of gravity in the physics world? Also, I don't think the restitution should be 1, but I could be wrong about that. I thought 1 was perfect elasticity which would result in infinite bounces but again, I could be wrong about that. – Kendel Jan 23 '15 at 21:58
  • Gravity was set to (0, 0). I am not worried about infinite bounces right now, I just want to fix the node sticking problem. Thanks for the input! – mjfish93 Jan 23 '15 at 22:22
  • i believe this is an expected artifact in physics engines, low speed means the ball may fall below a certain threshold (that you can't change in SK) which causes any collision to "absorb" the remaining velocity. Otherwise physics engines would struggle to get colliding bodies to come at rest at all, specifically when they are stacked. – CodeSmile Jan 24 '15 at 09:45
  • That's what I was thinking. If that was the case, is the only way to get around it to manually apply a force every collision? – mjfish93 Jan 24 '15 at 17:27
  • I have same issue in SceneKit when timeStep is 1/300. Is there some solution about it? – Sunrise17 Sep 13 '18 at 16:32

0 Answers0