class MAGES::FollowObject

Overview

Follows a GameObject, at a specified offset. More…

class FollowObject: public MonoBehaviour
{
public:
    // methods

    FollowObject Follow(
        GameObject target,
        Vector3 direction,
        float offset,
        bool relative = false
    );

    FollowObject IgnorePitchRelative(bool ignorePitch);
    FollowObject Elasticity(float elasticity);
    FollowObject Lazy(bool lazy, float interval = -1.0f);
    FollowObject Threshold(float threshold);
};

Detailed Documentation

Follows a GameObject, at a specified offset.

Methods

FollowObject Follow(
    GameObject target,
    Vector3 direction,
    float offset,
    bool relative = false
)

Follows a given game object.

Parameters:

target

The target game object.

direction

The direction to follow relative to the target object.

offset

The offset towards the direction.

relative

Whether or not the direction is relative to the target object.

Returns:

Self.

FollowObject IgnorePitchRelative(bool ignorePitch)

Ignores the pitch of the target object when using relative reference.

Parameters:

ignorePitch

The value to set.

Returns:

Self.

FollowObject Elasticity(float elasticity)

Sets the elasticity of the follow behavior.

Parameters:

elasticity

The new elasticity.

Returns:

Self.

FollowObject Lazy(bool lazy, float interval = -1.0f)

Makes the follow behavior lazy.

Parameters:

lazy

Whether the follow object will be lazy; this means that it will only perform the checks at each specified interval.

interval

The second before checks will be made.

Returns:

Self.

FollowObject Threshold(float threshold)

Sets the threshold of the follow behavior.

Parameters:

threshold

The distance threshold.

Returns:

Self.