Type Method

jointWithBodyA:bodyB:anchor:

Creates a new pin joint.

Declaration

+ (SKPhysicsJointPin *)jointWithBodyA:(SKPhysicsBody *)bodyA bodyB:(SKPhysicsBody *)bodyB anchor:(CGPoint)anchor;

Parameters

bodyA

The first body to connect. The body must be connected to a node that is already part of the scene’s node tree.

bodyB

The second body to connect. The body must be connected to a node that is already part of the scene’s node tree.

anchor

The connection point between the two bodies in the scene’s coordinate system.

Return Value

A new pin joint.

Discussion

You must add the joint to a physics world associated with the scene before it takes effect.

See Also