Type Entity

Entity type

Methods

applyAngForce (ang) Applies angular force to the entity
applyForceCenter (vec, offset) Applies linear force to the entity
applyForceOffset (vec, offset) Applies linear force to the entity with an offset
applyTorque (tq) Applies torque
enableGravity (grav) Sets entity gravity
entIndex () Returns the EntIndex of the entity
getAngleVelocity () Returns the angular velocity of the entity
getAngles () Returns the angle of the entity
getClass () Returns the class of the entity
getColor () Gets the color of an entity
getEyeAngles () Gets the entitiy's eye angles
getEyePos () Gets the entity's eye position
getForward () Gets the entities forward vector
getInertia () Returns the principle moments of inertia of the entity
getMass () Returns the mass of the entity
getMassCenter () Returns the local position of the entity's mass center
getMassCenterW () Returns the world position of the entity's mass center
getMaterial () Gets an entities' material
getModel () Gets the model of an entity
getOwner () Gets the owner of the entity
getPos () Returns the position of the entity
getRight () Gets the entities right vector
getUp () Gets the entities up vector
getVelocity () Returns the velocity of the entity
isFrozen () Checks the entities frozen state
isValid () Checks if an entity is valid.
isWeldedTo () Gets what the entity is welded to
localToWorld (data) Converts a vector in entity local space to world space
localToWorldAngles (data) Converts an angle in entity local space to world space
obbCenter () Returns the local position of the entity's outer bounding box
obbCenterW () Returns the world position of the entity's outer bounding box
obbSize () Returns the x, y, z size of the entity's outer bounding box (local to the entity)
setAngles (ang) Sets the entity's angles
setBodygroup (bodygroup, value) Sets an entities' bodygroup
setColor (clr) Sets the color of the entity
setFrozen (freeze) Sets the entity frozen state
setMaterial (material) Sets an entities' material
setParent (ent) Parents the entity to another entity
setPos (vec) Sets the entitiy's position
setSkin (skinIndex) Sets the skin of the entity
setSolid (solid) Sets the entity to be Solid or not.
setVelocity (vel) Sets the entity's linear velocity
unparent () Unparents the called entity.
worldToLocal (data) Converts a vector in world space to entity local space
worldToLocalAngles (data) Converts an angle in world space to entity local space


Methods

ents_methods:applyAngForce (ang)
Applies angular force to the entity
Deprecated: Gmod has no phys:ApplyAngleForce function, so this uses black magic

Parameters:

  • ang: The force angle
ents_methods:applyForceCenter (vec, offset)
Applies linear force to the entity

Parameters:

  • vec: The force vector
  • offset: An optional offset position
ents_methods:applyForceOffset (vec, offset)
Applies linear force to the entity with an offset

Parameters:

  • vec: The force vector
  • offset: An optional offset position
ents_methods:applyTorque (tq)
Applies torque
Deprecated: Gmod has no phys:ApplyTorque function, so this uses black magic

Parameters:

  • tq: The torque vector
ents_methods:enableGravity (grav)
Sets entity gravity

Parameters:

  • grav: Should the entity respect gravity?
ents_methods:entIndex ()
Returns the EntIndex of the entity

Return value:

    The numerical index of the entity
ents_methods:getAngleVelocity ()
Returns the angular velocity of the entity

Return value:

    The angular velocity vector
ents_methods:getAngles ()
Returns the angle of the entity

Return value:

    The angle
ents_methods:getClass ()
Returns the class of the entity

Return value:

    The string class name
ents_methods:getColor ()
Gets the color of an entity

Return value:

    Color
ents_methods:getEyeAngles ()
Gets the entitiy's eye angles

Return value:

    Angles of the entity's eyes
ents_methods:getEyePos ()
Gets the entity's eye position

Return values:

  1. Eye position of the entity
  2. In case of a ragdoll, the position of the other eye
ents_methods:getForward ()
Gets the entities forward vector
ents_methods:getInertia ()
Returns the principle moments of inertia of the entity

Return value:

    The principle moments of inertia as a vector
ents_methods:getMass ()
Returns the mass of the entity

Return value:

    The numerical mass
ents_methods:getMassCenter ()
Returns the local position of the entity's mass center

Return value:

    The position vector of the mass center
ents_methods:getMassCenterW ()
Returns the world position of the entity's mass center

Return value:

    The position vector of the mass center
ents_methods:getMaterial ()
Gets an entities' material

Return value:

    Material
ents_methods:getModel ()
Gets the model of an entity

Return value:

    Model of the entity
ents_methods:getOwner ()
Gets the owner of the entity

Return value:

    Owner
ents_methods:getPos ()
Returns the position of the entity

Return value:

    The position vector
ents_methods:getRight ()
Gets the entities right vector
ents_methods:getUp ()
Gets the entities up vector
ents_methods:getVelocity ()
Returns the velocity of the entity

Return value:

    The velocity vector
ents_methods:isFrozen ()
Checks the entities frozen state

Return value:

    True if entity is frozen
ents_methods:isValid ()
Checks if an entity is valid.

Return value:

    True if valid, false if not
ents_methods:isWeldedTo ()
Gets what the entity is welded to
ents_methods:localToWorld (data)
Converts a vector in entity local space to world space

Parameters:

  • data: Local space vector

Return value:

    data as world space vector
ents_methods:localToWorldAngles (data)
Converts an angle in entity local space to world space

Parameters:

  • data: Local space angle

Return value:

    data as world space angle
ents_methods:obbCenter ()
Returns the local position of the entity's outer bounding box

Return value:

    The position vector of the outer bounding box center
ents_methods:obbCenterW ()
Returns the world position of the entity's outer bounding box

Return value:

    The position vector of the outer bounding box center
ents_methods:obbSize ()
Returns the x, y, z size of the entity's outer bounding box (local to the entity)

Return value:

    The outer bounding box size
ents_methods:setAngles (ang)
Sets the entity's angles

Parameters:

  • ang: New angles
ents_methods:setBodygroup (bodygroup, value)
Sets an entities' bodygroup

Parameters:

  • bodygroup: Number, The ID of the bodygroup you're setting.
  • value: Number, The value you're setting the bodygroup to.

Return value:

    The Entity being modified.
ents_methods:setColor (clr)
Sets the color of the entity

Parameters:

  • clr: New color
ents_methods:setFrozen (freeze)
Sets the entity frozen state

Parameters:

  • freeze: Should the entity be frozen?
ents_methods:setMaterial (material)
Sets an entities' material

Parameters:

  • material: , string, New material name.

Return value:

    The Entity being modified.
ents_methods:setParent (ent)
Parents the entity to another entity

Parameters:

  • ent: Entity to parent to
ents_methods:setPos (vec)
Sets the entitiy's position

Parameters:

  • vec: New position
ents_methods:setSkin (skinIndex)
Sets the skin of the entity

Parameters:

  • skinIndex: Number, Index of the skin to use.

Return value:

    The Entity being modified.
ents_methods:setSolid (solid)
Sets the entity to be Solid or not. For more information please refer to GLua function http://wiki.garrysmod.com/page/Entity/SetNotSolid

Parameters:

  • solid: Boolean, Should the entity be solid?
ents_methods:setVelocity (vel)
Sets the entity's linear velocity

Parameters:

  • vel: New velocity
ents_methods:unparent ()
Unparents the called entity.
ents_methods:worldToLocal (data)
Converts a vector in world space to entity local space

Parameters:

  • data: World space vector

Return value:

    data as local space vector
ents_methods:worldToLocalAngles (data)
Converts an angle in world space to entity local space

Parameters:

  • data: World space angle

Return value:

    data as local space angle

Valid XHTML 1.0!