Contents

velocityField(direction:)

Creates and returns a field behavior object that applies a directional velocity to items.

Declaration

class func velocityField(direction: CGVector) -> Self

Parameters

  • direction:

    The vector indicating the direction of the velocity force. You can change this value later by modifying the Direction property.

Return Value

A field behavior object that applies a velocity to items.

Discussion

Velocity fields apply their velocity to the item, overriding any other acceleration forces currently on the item. The vector in the direction parameter is combined with the field strength to determine the velocity of items in the field.

See Also

Getting the field behaviors