FollowEntity(): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
Line 1: Line 1:
Used to control the [[Entity Hierarchy (parenting)|parent]] of the current entity.
C++ function used to control the [[Entity Hierarchy (parenting)|parent]] of the current entity.


==Syntax==
==Syntax==

Revision as of 09:47, 5 April 2008

C++ function used to control the parent of the current entity.

Syntax

FollowEntity( CBaseEntity *pBaseEntity, bool bBoneMerge = true )

Values

pBaseEntity
Defines a parent. In doing so:
pBaseEntity = NULL
The entity leaves its parent and moves on its own. StopFollowingEntity() may also be used, but it will not reset the entity's MoveType.
bBoneMerge = false
Prevent the current entity from moving with pBaseEntity's animations. It will move relative to pBaseEntity's origin only.
Todo: How to choose an attachment point?

Related functions

  • GetFollowedEntity() returns the parent entity as C_BaseEntity.
  • IsFollowingEntity() returns true is the entity has a parent.