Garry's Mod Wiki


void PhysObj:ApplyForceOffset( Vector force, Vector position )


Applies the specified force on the physics object at the specified position


1 Vector force
The force to be applied.
2 Vector position
The position in world coordinates where the force is applied to the physics object.


Pull what the player is looking at towards him.

local tr = Entity(1):GetEyeTrace() if IsValid(tr.Entity) then local phys = tr.Entity:GetPhysicsObjectNum(tr.PhysicsBone) local pushvec = tr.Normal * -100000 local pushpos = tr.HitPos phys:ApplyForceOffset(pushvec, pushpos) end

Page Links

Special Pages



Render Time: 29ms

Session 0
DB GetPage 5
Generate Html 1
SaveChanges 9
Render Body 0
Render Sidebar 11