Talk:Entity Hierarchy (parenting)

From Valve Developer Community
Revision as of 04:00, 22 October 2010 by Campaignjunkie (talk | contribs)

Jump to: navigation, search

Might want to add some pictures to get a better idea of parenting. Sometimes parenting can become very advanced, and this article doesn't explain all that may be needed of information.--Gear 01:37, 4 Sep 2007 (PDT)

Can entities be parented to the player in single-player? Would you just use "!player"? I've noticed that Baxayaun alluded to it in some of his SDK Project comments, but some experiments suggest that it doesn't work - the object often stays there, where the player spawned. --Campaignjunkie (talk) 18:02, 22 Oct 2007 (PDT)

A few collision and movement errors may happen if things are parented to "!player"... Also, has anyone noticed that the concommand: "ent_fire !picker setparent !player" works on physics objects like barrels and such? --Darthkillyou 09:25, 9 Mar 2008 (PDT)

prop_physics can be parented - although it shows as an error in Hammer. When you clear parent though, I think it reverts to wherever the object was when it was parented. I tested this by creating a rotating cube, parented a prop_physics to it, rotating, then clearing parents - the prop seemed to teleport back to where it was initially. --- RodeoClown 20:21, 8 Apr 2008 (PDT)

Also, physics collisions become messed up while parented (things pass through walls, etc.) --Darthkillyou 12:57, 13 May 2008 (PDT)

Parenting to NPCs?

Doesn't always work so well for some reason... especially when dealing with attachments. Is this something unique to Orange Box? I never seemed to run into these kinds of problems in the original HL2 SDK. --dky 16:11, 30 March 2010 (UTC)

I think you can't parent an object to an NPC because of the NPC's complex movement. For example, how do you think the child object would react if it was parented to an NPC that was shot by your pistol or something? --Nathaniel 02:42, 21 October 2010 (UTC)
Parenting to npcs works fine, it's used for Barney's mask take-off and crowbar toss. --Omnicoder 18:59, 21 October 2010 (UTC)
If you parent something to an NPC, it usually (or always?) becomes non-solid. --Campaignjunkie (talk) 04:00, 22 October 2010 (UTC)