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 Elasticity(float elasticity);
};

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 Elasticity(float elasticity)

Sets the elasticity of the follow behavior.

Parameters:

elasticity

The new elasticity.

Returns:

Self.