I try to simulate behavior of different types of balls (football ball, tennis, golf, volleyball etc). For these purposes I tried to change density, mass, size parameters of the physics body. In my game it doesn't have effect and I tried to simulate it in very simple app consists from ball and paddle
the ball always rises to the same height with the same speed regardless of mass, density, size
Is this because of restitution equals 1? How can I simulate behavior of different ball types in this way?
you need to change the restitution property as well as the Lin. Dampening and Ang. Dampening per ball
for my example i have
tennis ball - rest 0.6 lin 0.2 ang 0.2
soccer ball - rest. 0.5 lin 0.3 ang 0.2
golf ball - rest 0.8 lin 0.3 ang 0.3
shot put - rest 0.1 lin 0.1 ang 0.1
here is a link to the Apple definitions of the properties
https://developer.apple.com/documentation/spritekit/skphysicsbody/1519906-mass
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With