trigger_changeparent

XashXT

trigger_changeparent

An entity for dynamically changing an object's parent or unparenting an object.

Options

target Entity for which parenting should be changed or broken.
m_iszNewParent Name of the new parent (leave empty to unparent).

Usage Details

  • You can specify the *locus keyword in the m_iszNewParent field. This causes the entity in the target field to become a child of the entity that activated the trigger_changeparent.
  • Because the pointer to the activator is usually passed on unchanged by most entities, an arrangement like the following is possible: an entity passes a trigger_multiple or trigger_once, which activates a trigger_changeparent, which makes the object in its target field a child of the entity that passed the trigger. This makes it possible to implement a magnetic crane, for example. However, this is by far not the only use for the technique.