Entity.GetFriction

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:GetFriction( )
Description:
Gets the friction of an entity
Returns: Number Friction
In Object: Entity
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.GetFriction]Entity.GetFriction [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionIf the entitys friction is greater than 1, and it's going over a certain speed, it will slow down.
Used onNewerServer.png
Code
function ENT:PhysicsSimulate( phys, delta )
	if self:GetFriction() > 1 and self:GetVelocity():Length() > 100 then
		// Slow down duud!
		self:GetPhysicsObject():ApplyForceCenter(-self:GetVelocity())
	end
 
	return SIM_NOTHING
end
OutputN/A
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox