FollowEntity()

From Valve Developer Community
(Redirected from GetFollowedEntity())
Jump to navigation Jump to search

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.

Bones and Attachments

To find attachment points and bone names, there are several methods: Check modelname.qc(SourceSDK has examples), use hlmv or other model software, use ent_attachments console command, or LookupAttachment() if programming.

Todo: Code calls/console commands related to bones?

Related functions

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