Unity RTS Engine

  1. Home
  2. Unity RTS Engine
  3. Attack Behavior
  4. Attack Component – General

Attack Component – General

General Settings of the attack component. Units and buildings will be referred to as faction entities.


  1. Is Locked: When enabled, the faction entity will not be able to use this attack type or switch to it.
  2. Is Active: When enabled, the faction entity will be able to engage enemy units and attack them.
  3. Code: A unique code for each attack component allows you to inspect the attack components in the custom attack-related delegate events that the RTS Engine offers.
  4. Icon: An icon that represents this attack (this is only used when the faction entity has more than one attack component attached to it and the icons will be used to draw the tasks with which the player can switch from one attack to another).
  5. Basic: Enable this field if this attack component is the default attack behavior of the faction entity.
  6. Range (Units only): Defines the attacking unit’s stopping distance when engaging in an attack. Check the Unit Attack Range documentation page for more information.
  7. Target Picker: Attack Target PickerDefines the possible targets that the faction entity can engage with. Check the documentation page for more information.
  8. Engage On Assign: Enable if the player can assign targets to the faction entity.
  9. Engage When Attacked: Enable if the faction entity can attack back its attacker when it doesn’t have an already active target.
  10. Engage Once: Enable if the faction entity can only launch an attack and then the target has to be re-assigned.
  11. Engage Friendly: Enable if the faction entity can attack friendly units/buildings.
  12. Move On Attack (Units only): Enable if the unit can launch its attack while moving (towards the target).
  13. Engage In Range: Enable if the faction entity can automatically search for a target and engage it.
  14. Engage In Range On Idle Only: Disable to allow faction entities that are not in idle state to search for attack targets. When disabled, this allows attack units to lock targets in range even when they are moving.
  15. Search Range: If engaging in range is enabled, this defines the range in which the faction entity can search for a target. This value represents the attack range for buildings and for units that can not move.
  16. Search Reload: if engaging in range is enabled, this defines the time reload between each search for a target that the faction entity executes.
  17. Follow Distance (Units only): If the target escapes from the unit, then this value defines the maximum distance that the unit is allowed to follow the target for before it stops the attack.
  18. Require Target: When disabled, then the faction entity is able to launch an attack without having to be assigned a target. This is called a “Terrain Attack” and it can be toggled through the Attack Manager (this doc page also includes more information about this feature).
  19. Direct: Enable this option if the faction entity can apply damage directly to its target. Disable this if the faction entity launches an Attack Object towards the target which will only deal damage in case of collision with the target.
  20. Launch Type: In case the attack is not direct, there’s two possibilities to launch attack objects:
    1. Random: Randomly pick one attack object from the defined sources and launch it for each attack.
    2. In Order: Go through the entire sources list and launch attack objects in the order they have been added to the sources list.
  21. Attack Object Sources: This array defines the attack objects that the faction entity can launch during an attack, for each element assign:
    1. Attack Object: Drag and drop the attack object’s prefab into this field. This is the object that the faction entity will launch during the attack.
    2. Launch Position: The position of this transform is where the attack object will be launched from. Make sure that the transform assigned in this field is a child object of the faction entity’s main object.
    3. Launch Rotation Angles: The initial rotation that the attack object will have as soon as it is spawned. This is only valid if the attack object spawns in delay mode, else, the rotation of the attack object will be determined based on its path towards its target.
    4. Accuracy Modifier: For each axis (x,y and z) assign a positive value if the attack object’s movement is subject to accuracy modification. The higher the value is for each axis, the less accurate the movement of the attack object will eventually be on that axis. This feature is currently available for single player only.
    5. Delay Time: Time in seconds before the attack object assigned to this element is created/launched.
    6. Create In Delay: When enabled and the Delay Time is set, then the attack object will be created when the delay time is going but it will not be moving until the delay time is over.
    7. Damage In Delay: If the attack object can be created in delay and this is enabled then the attack object will be able to apply damage when in delay.
    8. Delay Parent Object: If the attack object can be created in the delay time, this will its parent object during the delay time. Ignore this field if the attack object doesn’t have a parent in delay. As soon as the delay time is over, the attack object will be parent-free and will start moving towards its target.
  22. Delay Duration: Before the attack is launched, a delay time can be assigned in this field to delay the attack. This can be useful in case the unit’s attack animation starts before the actual attack, the delay time can be set to the time required for the animation to reach the attack launch stage.
  23. Delay Trigger Enabled: Enable this option if you’d like to delay the attack launch until it’s triggered using an external component which calls the “TriggerAttack()” method in the attack component.
  24. Attack Override Controller (Units only): Allows to have a different attack animation for the current attack type.
  25. Trigger Animation In Delay (Units only): Enable this if you’d like to trigger the unit’s attack animation while the delay time is running.
  26. Use Reload: Enable to have a reload time for this attack.
  27. Reload Time: In case attack reload is enabled, this field represents the reload time in seconds.
  28. Cool Down Enabled: When enabled, the faction entity’s attack will enter cool down mode after an attack is launched.
  29. Cool Down Duration: If cool down is enabled, this field is the time duration of the cool down in seconds.

How can we help?