MF_AbstractPlatform
Typically, the base class of a weapon platform, but could be used for non-weapon platforms. This also provides a common point of reference for certain variables used by other scripts.
Public Variables
target : Transform
The target of this platform.
weaponMount : GameObject
The parent object for all weapons of this platform.
aimObjectActive : bool
If true, will enable aimObject. If false, will disable aimObject.
aimObject : GameObject
The object to use as an aim indicator. If a prefab, it will be created from that prefab.
emptyAimRange : float
If not aimed at a collider, the range to display aimObject.
fixedAimObjectRange : bool
If true, the aimObject will always appear at emptyAimRange. This also results in better performance. However, if the camera is not the same position as weaponMount, this will not line up with the aim point, but rather, just a point the the aim is projected through.
useIntercept : bool
If true, platform will calculate aim to hit a moving target.
useRootVelocity : bool
If true, will impart the unit’s velocity to fired shots, and will use the unit’s velocity in calculations.
velocityRoot : Transform
Specifies the location of the transform that will provide velocity information if useRootVelocity is true.
If blank, it will assume the root transform.
Hidden Variables
These are referenced by other scripts, and typically only set when they need to be used.
shotSpeed : float
exitLoc : Vector3
targetAimLocation : Vector3
targetRange : float
lastTargetPosition : Vector3
targetRigidbody : Rigidbody
velocity : Vector3
playerControl : bool
Public Methods
AimLocation : Vector3 ()
Adjusts aim location based on intercept settings.
AimCheck : bool ( targetSize : float, aimTolerance : float )
Used to determine if the platform is aimed at the target. Takes intercept into account.
TargetWithinLimits : bool ( targ : Transform )
Used to determine if a target is within the limits of a platform, and these limits are determined by different platform scripts. This returns true, but may be overridden by the platform script.
Typically, the base class of a weapon platform, but could be used for non-weapon platforms. This also provides a common point of reference for certain variables used by other scripts.
Public Variables
target : Transform
The target of this platform.
weaponMount : GameObject
The parent object for all weapons of this platform.
aimObjectActive : bool
If true, will enable aimObject. If false, will disable aimObject.
aimObject : GameObject
The object to use as an aim indicator. If a prefab, it will be created from that prefab.
emptyAimRange : float
If not aimed at a collider, the range to display aimObject.
fixedAimObjectRange : bool
If true, the aimObject will always appear at emptyAimRange. This also results in better performance. However, if the camera is not the same position as weaponMount, this will not line up with the aim point, but rather, just a point the the aim is projected through.
useIntercept : bool
If true, platform will calculate aim to hit a moving target.
useRootVelocity : bool
If true, will impart the unit’s velocity to fired shots, and will use the unit’s velocity in calculations.
velocityRoot : Transform
Specifies the location of the transform that will provide velocity information if useRootVelocity is true.
If blank, it will assume the root transform.
Hidden Variables
These are referenced by other scripts, and typically only set when they need to be used.
shotSpeed : float
exitLoc : Vector3
targetAimLocation : Vector3
targetRange : float
lastTargetPosition : Vector3
targetRigidbody : Rigidbody
velocity : Vector3
playerControl : bool
Public Methods
AimLocation : Vector3 ()
Adjusts aim location based on intercept settings.
AimCheck : bool ( targetSize : float, aimTolerance : float )
Used to determine if the platform is aimed at the target. Takes intercept into account.
TargetWithinLimits : bool ( targ : Transform )
Used to determine if a target is within the limits of a platform, and these limits are determined by different platform scripts. This returns true, but may be overridden by the platform script.