Add the Escape On Attack component to the main unit’s object in order to make the unit escape (move away in a random direction) when it takes damage. As an example, this can useful for animal units which the player hunts, once attacked they start escaping.
- Is Active: The unit will only escape when it receives damage if this field is enabled.
- NPC Only: When enabled, the component will only be active if the unit belongs to a NPC faction.
- Range: How far will the unit escape in relation to its position?
- Speed: When escaping, units can have a different movement speed that is set in this field.
- Escape Animator Controller: It is also possible to change the unit’s movement animation when escaping by using a different Animator Override Controller where the movement animation is different.