Entity Hierarchy (parenting)

From Valve Developer Community
(Redirected from Children)
Jump to: navigation, search
Русский 日本語 简体中文




All entities can have parents, though many entities do not include it in their FGD entries, and it may not necessarily function correctly. For example, prop_physics behave oddly when parented because they are physically simulated objects, and a logic_relay for example isn't visible or moves on its own, so parenting it would have little effect. For prop_physics, it's generally better to use a prop_dynamic or prop_dynamic_override instead or use the physics constraint system.

Warning.png Warning:  There is a limit of 512 entities permitted to be in a single parenting hierarchy/chain.

Child Behavior

  • Collision : Physics simulation will no longer occur for children, causing them to potentially pass through walls or other solid objects if the parent moves them there. Scripted movements such as animations or brush-based entities will still occur, so you can chain different brush entities together to form a complex moving contraption.
  • If a child does not define behavior for player interaction (+USE) or touching these will be relayed to the parent. This allows you to parent a prop_dynamic to a func_button and then have the player +USE the model to interact with the button, for example.



  • Maintains offset.
  • Additionally, an attachment point can be set by setting the value to parent,attachment. This can be used to have an entity follow an animated part of the model, such as the Howitzer handle in <Left 4 Dead>. It behaves like SetParentAttachmentMaintainOffset.
    For example: Howitzer_prop,Handle
The Howitzer handle, as separate prop, following the "Handle" $attachment of the Howitzer model.
(Click to play)



  • Maintains offset.


Note.png Note: Entities must be parented before being sent this input. Use at least a 0.1 second delay between SetParent and SetParentAttachment input, to ensure they run in the right order.




Note.png Note: Entities must be parented before being sent this input. Use at least a 0.1 second delay between SetParent and SetParentAttachmentMaintainOffset inputs, to ensure they run in the right order.






Note.png Note: This is the only movement hierarchy-related input that can be fired at the parent-entity.





