Guides

VRTK_ObjectFollow

Overview

Abstract class that allows to change one game object's properties to follow another game object.

Inspector Parameters

  • Game Object To Follow: The game object to follow. The followed property values will be taken from this one.
  • Game Object To Change: The game object to change the property values of. If left empty the game object this script is attached to will be changed.
  • Follows Position: Whether to follow the position of the given game object.
  • Smooths Position: Whether to smooth the position when following gameObjectToFollow.
  • Max Allowed Per Frame Distance Difference: The maximum allowed distance between the unsmoothed source and the smoothed target per frame to use for smoothing.
  • Follows Rotation: Whether to follow the rotation of the given game object.
  • Smooths Rotation: Whether to smooth the rotation when following gameObjectToFollow.
  • Max Allowed Per Frame Angle Difference: The maximum allowed angle between the unsmoothed source and the smoothed target per frame to use for smoothing.
  • Follows Scale: Whether to follow the scale of the given game object.
  • Smooths Scale: Whether to smooth the scale when following gameObjectToFollow.
  • Max Allowed Per Frame Size Difference: The maximum allowed size between the unsmoothed source and the smoothed target per frame to use for smoothing.

Class Variables

  • public Vector3 targetPosition { get private set } - The position that results by following gameObjectToFollow.
  • public Quaternion targetRotation { get private set } - The rotation that results by following gameObjectToFollow.
  • public Vector3 targetScale { get private set } - The scale that results by following gameObjectToFollow.

Class Methods

Follow/0

public virtual void Follow()

  • Parameters
    • none
  • Returns
    • none

Follow gameObjectToFollow using the current settings.


Did this page help you?