PhysObj/UpdateShadow

From Garry's Mod
Jump to: navigation, search
 PhysObj:UpdateShadow( )

Contents

Description

Unlike PhysObj:SetPos and PhysObj:SetAngles, this allows the movement of a physobj while leaving physics interactions intact.
This is used internally by the motion controller of the Gravity Gun , the +use pickup and the Physics Gun, and entities such as the crane.

NOTE

This is the ideal function to move a physics shadow created with Entity:PhysicsInitShadow or Entity:MakePhysicsObjectAShadow.

Arguments

Vector targetPosition

The position we should move to.

Arguments

Angle targetAngles

The angle we should rotate towards.

Arguments

number frameTime

The frame time to use for this movement, can be generally filled with FrameTime or ENTITY:PhysicsSimulate with the deltaTime.

Can be set to 0 when you need to update the physics object just once.
Personal tools
Navigation