FollowEntity(): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
Line 13: Line 13:
:*Adds <code>[[FSOLID_NOT_SOLID]]</code>
:*Adds <code>[[FSOLID_NOT_SOLID]]</code>
;<code>pBaseEntity = NULL</code>
;<code>pBaseEntity = NULL</code>
:The entity leaves its parent and moves on its own. <code>StopFollowingEntity()</code> may also be used.
:The entity leaves its parent and moves on its own. <code>StopFollowingEntity()</code> may also be used, but it will not reset the entity's <code>[[MoveType]]</code>.
;<code>bBoneMerge = false</code>
;<code>bBoneMerge = false</code>
:Prevent the current entity from moving with <code>pBaseEntity</code>'s animations. It will move relative to <code>pBaseEntity</code>'s origin only.
:Prevent the current entity from moving with <code>pBaseEntity</code>'s animations. It will move relative to <code>pBaseEntity</code>'s origin only.


{{TODO|How to choose an attachment point?}}
{{TODO|How to choose an attachment point?}}
== Related functions ==
*'''<code>GetFollowedEntity()</code>''' returns the parent entity as <code>C_BaseEntity</code>.
*'''<code>IsFollowingEntity()</code>''' returns <code>true</code> is the entity has a parent.


[[Category:Functions]]
[[Category:Functions]]

Revision as of 01:57, 5 April 2008

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.