AIScriptChargeEnemies Class
An AI script object. Causes the entity to speed up if an enemy entity is detected in front of it. The speed increase is handled by a spell effect, so the corresponding component needs to be present on the entity, additionally the GroundedMovement component, a Position and a FacingDirection are required. This script doesn't cause the entity to move, it should be paired with the walk script.
Constructor
AIScriptChargeEnemies
-
chargeTargetDetectorRange
-
chargingSpeedMultiplier
Parameters:
-
chargeTargetDetectorRange
NumberThe enemy detection range. The script uses a ray to query for enemies. The ray is constructed automatically by using a ground tangent stored on the GroundedMovement component. Thanks to this, the ray always runs along the ground and the entity can charge enemies up and down hill.
-
chargingSpeedMultiplier
NumberThe speed multiplier that will be used to construct the MovementSpeedSpellEffect.
Item Index
Methods
getChargeTargetDetectorRange
()
Number
Returns:
getChargingSpeedMultiplier
()
Number
Returns:
isCharging
()
Boolean
Returns:
setChargeTargetDetectorRange
-
chargeTargetDetectorRange
Parameters:
-
chargeTargetDetectorRange
NumberThe enemy detection range. The script uses a ray to query for enemies. The ray is constructed automatically by using a ground tangent stored on the GroundedMovement component. Thanks to this, the ray always runs along the ground and the entity can charge enemies up and down hill.
setChargingSpeedMultiplier
-
chargingSpeedMultiplier
Parameters:
-
chargingSpeedMultiplier
NumberThe speed multiplier that will be used to construct the MovementSpeedSpellEffect.