PhysObj.EnableMotion

From GMod Wiki

Jump to: navigation, search
Function
Syntax PhysObj:EnableMotion( Boolean enable )
Description:
Enables or disables the motion of an object.
Returns: nil
In Object: Physobj
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=PhysObj.EnableMotion]PhysObj.EnableMotion [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionFreezes an entity's physics object at the end of initialization.
Used onNewerServer.png
Code
function ENT:Initialize()
 
	-- Rest of initialization goes here.
 
	local phys = self:GetPhysicsObject()
 
	if phys and phys:IsValid() then
		phys:EnableMotion(false) -- Freezes the object in place.
	end
 
end
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox