A joint that allows two physics bodies to slide along an axis.


class SKPhysicsJointSliding : SKPhysicsJoint


An SKPhysicsJointSliding object allows the anchor points of the two physics bodies to slide along a chosen axis. The joint can be configured to limit the distance that the two objects are allowed to slide along the axis.


Configuring the Limits of the Sliding Joint

var shouldEnableLimits: Bool

A Boolean value that indicates whether the sliding joint is restricted so that the objects may only slide a finite distance from the initial anchor point.

var lowerDistanceLimit: CGFloat

The smallest distance allowed for the sliding joint.

var upperDistanceLimit: CGFloat

The largest distance allowed for the sliding joint.


Inherits From

Conforms To

See Also

Simulating Physics

class SKPhysicsWorld

An object which encapsulates a scene's physics simulation.

class SKPhysicsBody

An object which adds physics simulation to a node.

class SKPhysicsContact

A description of the contact between two physics bodies.

protocol SKPhysicsContactDelegate

Methods your app can implement to respond when physics bodies come into contact.

class SKPhysicsJoint

The abstract superclass for objects that connect physics bodies.

class SKPhysicsJointFixed

A joint that fixes two physics bodies together.

class SKPhysicsJointLimit

A joint that imposes a maximum distance between two physics bodies, as if they were connected by a rope.

class SKPhysicsJointPin

A joint that pins together two physics bodies, allowing independent rotation.

class SKPhysicsJointSpring

A joint that simulates a spring connecting two physics bodies.

class SKFieldNode

A node that applies physics effects to a portion of the scene.

class SKRegion

A definition of an arbitrary area.