applyTorque(_:duration:)
Creates an action that applies a torque to a node’s physics body.
Declaration
class func applyTorque(_ torque: CGFloat, duration: TimeInterval) -> SKActionParameters
- torque:
The amount of torque, in Newton-meters.
- duration:
The duration over which the torque is applied to the physics body.
Return Value
A new action object.
Discussion
When the action executes, the torque is applied continuously to the physics body for the duration of the action. This action generates an angular acceleration on the body without causing any linear acceleration.
This action is reversible; it applies an equal torque in the opposite direction.
See Also
Animating Properties of a Node’s Physics Body
applyForce(_:duration:)applyForce(_:at:duration:)applyImpulse(_:duration:)applyAngularImpulse(_:duration:)applyImpulse(_:at:duration:)applyImpulse(_:duration:)changeCharge(to:duration:)changeCharge(by:duration:)changeMass(to:duration:)changeMass(by:duration:)strength(to:duration:)strength(by:duration:)falloff(to:duration:)falloff(by:duration:)