Garry's Mod Wiki

Revision Difference

Entity:PhysicsInitShadow#545901

<function name="PhysicsInitShadow" parent="Entity" type="classfunc"> <description> Initializes the entity's physics object as a physics shadow. Removes the previous physics object if successful. This is used internally for the Player's and NPC's physics object, and certain HL2 entities such as the crane. A physics shadow can be used to have static entities that never move by setting both arguments to false. <bug>Clientside physics objects are broken and do not move properly in some cases. Physics objects should only created on the server or you will experience incorrect physgun beam position, prediction issues, and other unexpected behavior.</bug> <bug issue="5060">Clientside physics objects are broken and do not move properly in some cases. Physics objects should only created on the server or you will experience incorrect physgun beam position, prediction issues, and other unexpected behavior. A workaround is available on the <page>Entity:PhysicsInitConvex</page> page.</bug> </description> <realm>Shared</realm> <args> <arg name="allowPhysicsMovement" type="boolean" default="true">Whether to allow the physics shadow to move under stress.</arg> <arg name="allowPhysicsRotation" type="boolean" default="true">Whether to allow the physics shadow to rotate under stress.</arg> </args> <rets> <ret name="" type="boolean">Return true on success, nil otherwise.</ret> <ret name="" type="boolean">Return `true` on success, `nil` otherwise.</ret> </rets> </function>