Shield
1. What it does
A shield companion absorbs lethal hits. Levels 1 and 2 each absorb one hit (then 1.5 s protected, hero blinking); level 3 makes the hero invulnerable for 20 s. A Shield crate or Add Shield Level gives one level; the kit grants one automatically after 5 and 10 deaths since the checkpoint.
2. Turn on / off
- Details: Corridor | Abilities > Can Use Shield.
- Blueprint:
Set Ability Enabled(Ability = Shield) /Is Ability Enabled. - Routes: B only.
- Off: no shield is ever granted and every lethal hit kills. Switched off with a shield worn: the shield is removed. A hardcore game turns this off.
3. Level actor to place
A Corridor Crate with Type = Shield, or call Add Shield Level from Blueprint.
4. Details fields
| Field | Default | What it does |
|---|---|---|
Hit Protect Time (HitProtectTime) |
1.5 | No damage for this long after the shield took a hit (the hero blinks). (Details: Corridor | Shield) |
Invulnerable Time (InvulnerableTime) |
20 | How long the third shield level makes the hero invulnerable (touching crates breaks them, fuse box goes off at once). (Details: Corridor | Shield) |
5. Blueprint functions and events
| Node | Kind | What it does |
|---|---|---|
| Set Ability Enabled / Is Ability Enabled | Function / Getter | The switch above (Ability = Shield). |
| Add Shield Level (shield component) | Function | One more level. |
| Get Level, Is Invulnerable, Get Invulnerable Left | Getters | The state. |
There is no action value for the shield (it is a companion, not a pose).
6. Use your own animation
Nothing to blend: the shield has no hero pose.
7. See it in the demo
Any course after a few deaths; Course2_EnemiesHazards for a quick test.
8. Pitfalls
- Pits, water, drowning, lava and ice go through the shield, as does any hazard with Ignore Shield; squash and poison are absorbed.
- Hazards you build yourself should call the hero's Take Hit so the shield can take the hit.
- An immortal hero (Immortal) is unaffected by this switch.
Shield details from the guide
A Shield crate (or UCorridorShieldComponent::AddShieldLevel) gives the shield companion. Shield level 1 and 2 each absorb one lethal hit, then 1.5 s (HitProtectTime) without damage with the hero blinking. The third shield level makes the hero invulnerable for InvulnerableTime (20 s): touching crates breaks them, fuse box goes off at once. Pits, water, drowning, lava and ice go through the shield, as does any hazard with bIgnoreShield; squash and poison are absorbed. Hazards and enemies you build yourself should call the hero's TakeHit so the shield can take the hit. GetLevel and IsInvulnerable read the state.