I'd like to know if there's any way to make a sprite have the same "amount of bouncing" when colliding with other objects in Sprite Kit. I mean, I want it move with the same force after a collision. I have set both colliding objects restitution to 1.0 but after some collisions and in a certain angle, the sprite decelerates.
0
votes
1 Answers
0
votes
First: Change the gravity of the physics world to zero
self.physicsWorld.gravity = CGVector(dx: 0, dy: 0)
Second: Reduce the body’s linear velocity (LinearDamping)
myBall.physicsBody!.linearDamping = 0
Third: Change the bounciness of the physics body
myBall.physicsBody!.restitution = 0
Fourth: Change the Friction
myBall.physicsBody!.friction = 0
See the whole explanation in the DevelopApps.org website http://www.developapps.org/sprite-kit-tutorial-how-to-make-a-node-keep-bouncing/
self.physicsBody?.friction = 0- Knight0fDragonnode.physicsBody?.linearDamping = 0- 0x141E