DestroyChildAction - acrimi/Raven GitHub Wiki

Extends ChildAction

DestroyChildAction is an implementation of ChildAction that destroys a child of the triggering entity. By default, the child entity will be destroyed immediately, but the action can be configured to instead attempt to destroy the child indirectly by setting the hp property of its HealthComponent to 0. If the child has no HealthComponent, they will be destroyed immediately regardless.

Configuration

The following parameters can be used to configure the action's behavior:

Key Type Description
immediate boolean If true, the child entity will be immediately destroyed upon execution, otherwise the action will simply attempt to set its hp to 0. Defaults to true.
type* string The type of the child entity that should be targeted by the action
tag* string The tag of the child entity that should be targeted by the action
linkedBy* string The name of a component that implements ChildLinkedComponent. The target child will be determined by the value of the component's childId property, optionally filtered against type and tag if present.

* from ChildAction

Example:

"eventName": {
  "action": "DestroyChildAction",
  "type": "fireball",
  "tag": "magicSpawn",
  "linkedBy": "CarryComponent",
  "immediate": false
}
⚠️ **GitHub.com Fallback** ⚠️