Garry's Mod Wiki

PhysObj:ComputeShadowControl

  PhysObj:ComputeShadowControl( table shadowparams )

Description

Allows you to move a PhysObj to a point and angle in 3D space.

Arguments

1 table shadowparams
The parameters for the shadow. See ShadowControlParams structure.

Example

Move a PhysObj to vector 0 0 0 with angles 0 0 0.

function ENT:Initialize() self:StartMotionController() self.ShadowParams = {} end function ENT:PhysicsSimulate( phys, deltatime ) phys:Wake() self.ShadowParams.secondstoarrive = 1 self.ShadowParams.pos = Vector( 0, 0, 0 ) self.ShadowParams.angle = Angle( 0, 0, 0 ) self.ShadowParams.maxangular = 5000 self.ShadowParams.maxangulardamp = 10000 self.ShadowParams.maxspeed = 1000000 self.ShadowParams.maxspeeddamp = 10000 self.ShadowParams.dampfactor = 0.8 self.ShadowParams.teleportdistance = 200 self.ShadowParams.delta = deltatime phys:ComputeShadowControl(self.ShadowParams) end