Garry's Mod Wiki

Garry's Mod Wiki

  PhysObj Entity:GetPhysicsObject()

Description

Returns the entity's physics object, if the entity has physics.

Entities don't have clientside physics objects by default, so this will return [NULL PHYSOBJ] on the client in most cases.

Returns

1 PhysObj
The entity's physics object.

Example

Gets the mass of an entity.

local phys = ent:GetPhysicsObject() if ( IsValid( phys ) ) then -- Always check with IsValid! The ent might not have physics! return phys:GetMass() else return 0 end

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...