In my SpriteKit
project, I am learning to use the wonderful, built in physics engine. I am accomplishing this through the use of SKPhysicsBody
instances attached to nodes, and it has worked out well so far. My current set up is when I add a node, I set its physicsBody
's velocity
vector to some constant velocity. Despite manually setting the velocity to some fixed value, after a few seconds of nodes colliding, their velocity decreases. I assume this is the default characteristic as it simulates real life physics (loss of energy through multiple collisions). I would like to stop this behavior. For example, I would like, despite numerous collisions, all energy to be perfectly "preserved" and no velocity lost. Here are a few things I have tried to no avail.
physicsBody.linearDamping = 0;
physicsBody.friction = 0;
Is this even a physicsBody
property, or does this behaviour stem from a property on the SKScene
's physicsWorld
property?