Garry's Mod Wiki

Entity:SetParent

Entity:SetParent

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

Description

Sets the parent of this entity, making it move with its parent. This will make the child entity non solid, nothing can interact with them, including traces.

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.

Arguments

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!

Special Pages


Wikis

?

Render Time: 56ms

DB GetPage 39
Generate Html 3
SaveChanges (1) 5
Render Body 0
Render Sidebar 6