Corgi Engine
v9.2
|
Add this component to an object and it'll get moved towards the target at update, with or without interpolation based on your settings More...
Public Types | |
enum | UpdateModes { UpdateModes.Update, UpdateModes.FixedUpdate, UpdateModes.LateUpdate } |
the possible update modes More... | |
enum | FollowModes { FollowModes.RegularLerp, FollowModes.MMLerp, FollowModes.MMSpring } |
the possible follow modes More... | |
enum | PositionSpaces { PositionSpaces.World, PositionSpaces.Local } |
whether to operate in world or local space More... | |
Public Member Functions | |
virtual void | Initialization () |
Initializes the follow More... | |
virtual void | StopFollowing () |
Prevents the object from following the target anymore More... | |
virtual void | StartFollowing () |
Makes the object follow the target More... | |
virtual void | ChangeFollowTarget (Transform newTarget) |
Public Attributes | |
bool | FollowPosition = true |
whether or not the object is currently following its target's position More... | |
bool | FollowPositionX = true |
whether this object should follow its target on the X axis More... | |
bool | FollowPositionY = true |
whether this object should follow its target on the Y axis More... | |
bool | FollowPositionZ = true |
whether this object should follow its target on the Z axis More... | |
PositionSpaces | PositionSpace = PositionSpaces.World |
whether to operate in world or local space More... | |
bool | FollowRotation = true |
whether or not the object is currently following its target's rotation More... | |
bool | FollowScale = true |
whether or not the object is currently following its target's rotation More... | |
float | FollowScaleFactor = 1f |
the factor to apply to the scale when following More... | |
Transform | Target |
the target to follow More... | |
Vector3 | Offset |
the offset to apply to the followed target More... | |
bool | AddInitialDistanceXToXOffset = false |
whether or not to add the initial x distance to the offset More... | |
bool | AddInitialDistanceYToYOffset = false |
whether or not to add the initial y distance to the offset More... | |
bool | AddInitialDistanceZToZOffset = false |
whether or not to add the initial z distance to the offset More... | |
bool | InterpolatePosition = true |
whether or not we need to interpolate the movement More... | |
FollowModes | FollowPositionMode = FollowModes.MMLerp |
the follow mode to use when following position More... | |
float | FollowPositionSpeed = 10f |
the speed at which to interpolate the follower's movement More... | |
float | PositionSpringDamping = 0.3f |
higher values mean more damping, less spring, low values mean less damping, more spring More... | |
float | PositionSpringFrequency = 3f |
the frequency at which the spring should "vibrate", in Hz (1 : the spring will do one full period in one second) More... | |
bool | InterpolateRotation = true |
whether or not we need to interpolate the movement More... | |
FollowModes | FollowRotationMode = FollowModes.MMLerp |
the follow mode to use when interpolating the rotation More... | |
float | FollowRotationSpeed = 10f |
the speed at which to interpolate the follower's rotation More... | |
float | RotationSpringDamping = 0.3f |
higher values mean more damping, less spring, low values mean less damping, more spring More... | |
float | RotationSpringFrequency = 3f |
the frequency at which the spring should "vibrate", in Hz (1 : the spring will do one full period in one second) More... | |
bool | InterpolateScale = true |
whether or not we need to interpolate the scale More... | |
FollowModes | FollowScaleMode = FollowModes.MMLerp |
the follow mode to use when interpolating the scale More... | |
float | FollowScaleSpeed = 10f |
the speed at which to interpolate the follower's scale More... | |
float | ScaleSpringDamping = 0.3f |
higher values mean more damping, less spring, low values mean less damping, more spring More... | |
float | ScaleSpringFrequency = 3f |
the frequency at which the spring should "vibrate", in Hz (1 : the spring will do one full period in one second) More... | |
UpdateModes | UpdateMode = UpdateModes.Update |
the update at which the movement happens More... | |
bool | DisableSelfOnSetActiveFalse = false |
if this is true, this component will self disable when its host game object gets disabled More... | |
bool | UseMinimumDistanceBeforeFollow = false |
whether or not to force a minimum distance between the object and its target before it starts following More... | |
float | MinimumDistanceBeforeFollow = 1f |
the minimum distance to keep between the object and its target More... | |
bool | UseMaximumDistance = false |
whether or not we want to make sure the object is never too far away from its target More... | |
float | MaximumDistance = 1f |
the maximum distance at which the object can be away from its target More... | |
bool | AnchorToInitialPosition |
if this is true, the movement will be constrained around the initial position More... | |
float | MaxDistanceToAnchor = 1f |
the maximum distance around the initial position at which the transform can move More... | |
Protected Member Functions | |
virtual void | Start () |
On start we store our initial position More... | |
virtual void | SetInitialPosition () |
Stores the initial position More... | |
virtual void | SetOffset () |
Adds initial offset to the offset if needed More... | |
virtual void | Update () |
At update we follow our target More... | |
virtual void | FixedUpdate () |
At fixed update we follow our target More... | |
virtual void | LateUpdate () |
At late update we follow our target More... | |
virtual void | FollowTargetPosition () |
Follows the target, lerping the position or not based on what's been defined in the inspector More... | |
virtual float | ApplyMinMaxDistancing (float trueDistance, float interpolatedDistance) |
Applies minimal and maximal distance rules to the interpolated distance More... | |
virtual void | FollowTargetRotation () |
Makes the object follow its target's rotation More... | |
virtual void | FollowTargetScale () |
Makes the object follow its target's scale More... | |
virtual void | OnDisable () |
Protected Attributes | |
Vector3 | _positionVelocity = Vector3.zero |
Vector3 | _scaleVelocity = Vector3.zero |
Vector3 | _rotationVelocity = Vector3.zero |
Vector3 | _initialPosition |
Vector3 | _direction |
Vector3 | _newPosition |
Vector3 | _newRotation |
Vector3 | _newScale |
Vector3 | _newTargetPosition |
Quaternion | _newTargetRotation |
Vector3 | _newTargetRotationEulerAngles |
Vector3 | _newTargetRotationEulerAnglesLastFrame |
Vector3 | _newTargetScale |
float | _rotationFloatVelocity |
float | _rotationFloatCurrent |
float | _rotationFloatTarget |
Vector3 | _currentRotationEulerAngles |
Quaternion | _rotationBeforeSpring |
Quaternion | _initialRotation |
Vector3 | _lastTargetPosition |
Properties | |
bool | _localSpace [get] |
Add this component to an object and it'll get moved towards the target at update, with or without interpolation based on your settings
|
strong |
|
strong |
|
protectedvirtual |
Applies minimal and maximal distance rules to the interpolated distance
trueDistance | |
interpolatedDistance |
|
virtual |
|
protectedvirtual |
At fixed update we follow our target
|
protectedvirtual |
Follows the target, lerping the position or not based on what's been defined in the inspector
|
protectedvirtual |
Makes the object follow its target's rotation
|
protectedvirtual |
Makes the object follow its target's scale
|
virtual |
Initializes the follow
|
protectedvirtual |
At late update we follow our target
|
protectedvirtual |
|
protectedvirtual |
Stores the initial position
|
protectedvirtual |
Adds initial offset to the offset if needed
|
protectedvirtual |
On start we store our initial position
|
virtual |
Makes the object follow the target
|
virtual |
Prevents the object from following the target anymore
|
protectedvirtual |
At update we follow our target
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
bool MoreMountains.Tools.MMFollowTarget.AddInitialDistanceXToXOffset = false |
whether or not to add the initial x distance to the offset
bool MoreMountains.Tools.MMFollowTarget.AddInitialDistanceYToYOffset = false |
whether or not to add the initial y distance to the offset
bool MoreMountains.Tools.MMFollowTarget.AddInitialDistanceZToZOffset = false |
whether or not to add the initial z distance to the offset
bool MoreMountains.Tools.MMFollowTarget.AnchorToInitialPosition |
if this is true, the movement will be constrained around the initial position
bool MoreMountains.Tools.MMFollowTarget.DisableSelfOnSetActiveFalse = false |
if this is true, this component will self disable when its host game object gets disabled
bool MoreMountains.Tools.MMFollowTarget.FollowPosition = true |
whether or not the object is currently following its target's position
FollowModes MoreMountains.Tools.MMFollowTarget.FollowPositionMode = FollowModes.MMLerp |
the follow mode to use when following position
float MoreMountains.Tools.MMFollowTarget.FollowPositionSpeed = 10f |
the speed at which to interpolate the follower's movement
bool MoreMountains.Tools.MMFollowTarget.FollowPositionX = true |
whether this object should follow its target on the X axis
bool MoreMountains.Tools.MMFollowTarget.FollowPositionY = true |
whether this object should follow its target on the Y axis
bool MoreMountains.Tools.MMFollowTarget.FollowPositionZ = true |
whether this object should follow its target on the Z axis
bool MoreMountains.Tools.MMFollowTarget.FollowRotation = true |
whether or not the object is currently following its target's rotation
FollowModes MoreMountains.Tools.MMFollowTarget.FollowRotationMode = FollowModes.MMLerp |
the follow mode to use when interpolating the rotation
float MoreMountains.Tools.MMFollowTarget.FollowRotationSpeed = 10f |
the speed at which to interpolate the follower's rotation
bool MoreMountains.Tools.MMFollowTarget.FollowScale = true |
whether or not the object is currently following its target's rotation
float MoreMountains.Tools.MMFollowTarget.FollowScaleFactor = 1f |
the factor to apply to the scale when following
FollowModes MoreMountains.Tools.MMFollowTarget.FollowScaleMode = FollowModes.MMLerp |
the follow mode to use when interpolating the scale
float MoreMountains.Tools.MMFollowTarget.FollowScaleSpeed = 10f |
the speed at which to interpolate the follower's scale
bool MoreMountains.Tools.MMFollowTarget.InterpolatePosition = true |
whether or not we need to interpolate the movement
bool MoreMountains.Tools.MMFollowTarget.InterpolateRotation = true |
whether or not we need to interpolate the movement
bool MoreMountains.Tools.MMFollowTarget.InterpolateScale = true |
whether or not we need to interpolate the scale
float MoreMountains.Tools.MMFollowTarget.MaxDistanceToAnchor = 1f |
the maximum distance around the initial position at which the transform can move
float MoreMountains.Tools.MMFollowTarget.MaximumDistance = 1f |
the maximum distance at which the object can be away from its target
float MoreMountains.Tools.MMFollowTarget.MinimumDistanceBeforeFollow = 1f |
the minimum distance to keep between the object and its target
Vector3 MoreMountains.Tools.MMFollowTarget.Offset |
the offset to apply to the followed target
PositionSpaces MoreMountains.Tools.MMFollowTarget.PositionSpace = PositionSpaces.World |
whether to operate in world or local space
float MoreMountains.Tools.MMFollowTarget.PositionSpringDamping = 0.3f |
higher values mean more damping, less spring, low values mean less damping, more spring
float MoreMountains.Tools.MMFollowTarget.PositionSpringFrequency = 3f |
the frequency at which the spring should "vibrate", in Hz (1 : the spring will do one full period in one second)
float MoreMountains.Tools.MMFollowTarget.RotationSpringDamping = 0.3f |
higher values mean more damping, less spring, low values mean less damping, more spring
float MoreMountains.Tools.MMFollowTarget.RotationSpringFrequency = 3f |
the frequency at which the spring should "vibrate", in Hz (1 : the spring will do one full period in one second)
float MoreMountains.Tools.MMFollowTarget.ScaleSpringDamping = 0.3f |
higher values mean more damping, less spring, low values mean less damping, more spring
float MoreMountains.Tools.MMFollowTarget.ScaleSpringFrequency = 3f |
the frequency at which the spring should "vibrate", in Hz (1 : the spring will do one full period in one second)
Transform MoreMountains.Tools.MMFollowTarget.Target |
the target to follow
UpdateModes MoreMountains.Tools.MMFollowTarget.UpdateMode = UpdateModes.Update |
the update at which the movement happens
bool MoreMountains.Tools.MMFollowTarget.UseMaximumDistance = false |
whether or not we want to make sure the object is never too far away from its target
bool MoreMountains.Tools.MMFollowTarget.UseMinimumDistanceBeforeFollow = false |
whether or not to force a minimum distance between the object and its target before it starts following
|
getprotected |