Entity/SetParent

From Garry's Mod
Jump to: navigation, search
 Entity:SetParent( )

Description

Sets the parent of this entity, making it move with its parent.

NOTE

This does not work on the world.

WARNING

This can cause undefined physics behaviour when used on entities that don't support parenting. See the Valve developer wiki for more information.

Arguments

Entity parent=NULL

The entity to parent to. Setting this to nil will clear the parent.

Arguments

number attachmentId=-1

The attachment id to use when parenting, defaults to -1 or whatever the parent had set previously.

NOTE

You must call Entity:SetMoveType( MOVETYPE_NONE ) on the child for this argument to have any effect!

Personal tools
Navigation