Inherits from KKBehavior : NSObject
Declared in KKFollowTargetBehavior.h

Overview

Updates the owning node’s position from another node’s position, applying optional offset and/or multiplier. The multiplier can be used to achieve a parallaxing effect.

Properties

positionMultiplier

The target’s position is multiplied by this position multiplier before the resulting point is set as the node’s position.

@property (atomic) CGPoint positionMultiplier

Declared In

KKFollowTargetBehavior.h

positionOffset

The target’s position has this offset added before the resulting point is set as the node’s position.

@property (atomic) CGPoint positionOffset

Declared In

KKFollowTargetBehavior.h

target

The target the behavior’s node is following.

@property (atomic, weak) SKNode *target

Declared In

KKFollowTargetBehavior.h

Class Methods

followTarget:

Follow another node.

+ (id)followTarget:(SKNode *)target

Parameters

target

The node to follow.

Return Value

A new instance.

Declared In

KKFollowTargetBehavior.h

followTarget:offset:

Follow another node at an offset.

+ (id)followTarget:(SKNode *)target offset:(CGPoint)positionOffset

Parameters

target

The node to follow.

positionOffset

The offset to add to the target’s position.

Return Value

A new instance.

Declared In

KKFollowTargetBehavior.h

followTarget:offset:multiplier:

Follow another node at an offset with multiplier (for parallaxing effect).

+ (id)followTarget:(SKNode *)target offset:(CGPoint)positionOffset multiplier:(CGPoint)positionMultiplier

Parameters

target

The node to follow.

positionOffset

The offset to add to the target’s position.

positionMultiplier

Multiply the target position by these multipliers.

Return Value

A new instance.

Declared In

KKFollowTargetBehavior.h