I am developing a simple Golf game as shown in the below image.
I am facing below issues:
Physics properties of the ball:
ball.physicsBody.affectedByGravity = true;
ball.physicsBody.mass = 0.0450;
ball.physicsBody.restitution = 0.8;
ball.physicsBody.friction = 0.3;
ball.physicsBody.allowsResting = true;
Physics properties of the grass:
golf.physicsBody.friction = 0.8;
Physics properties of the walls:
leftWall.physicsBody.friction = 0;
leftWall.physicsBody.restitution = 0.8;
I have set the physics world gravity value to -9.8.
I am looking for suggestions to fix the above listed issue. Thank you.
friction is for sliding friction. i don't think your golf balls slide. they roll.
look at physicsBody.rollingFriction, it appears the default is zero which means it will roll w/o stopping.