Garry's Mod Wiki


Entity:SetParent( Entity parent = NULL, number attachmentId = -1 )


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

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


1 Entity parent = NULL
The entity to parent to. Setting this to nil will clear the parent.
2 number attachmentId = -1
The attachment id to use when parenting, defaults to -1 or whatever the parent had set previously.

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

Page Links

Special Pages



Render Time: 39ms

DB GetPage 3
Generate Html 4
SaveChanges (1) 10
Render Body 0
Render Sidebar 19