Garry's Mod Wiki

Revision Difference

Entity:PhysicsInitBox#514627

<function name="PhysicsInitBox" parent="Entity" type="classfunc">⤶ <description>⤶ Makes the physics object of the entity a AABB.⤶ ⤶ <note>If the volume of the resulting box is 0 (the mins and maxs are the same), the mins and maxs will be changed to <page>Global.Vector</page>( -1, -1, -1 ) and <page>Global.Vector</page>( 1, 1, 1 ), respectively.</note>⤶ ⤶ <note>This function will automatically destroy any previous physics objects if successful and call <page>Entity:SetSolid</page>( SOLID_BBOX ), <page>Entity:SetMoveType</page>( MOVETYPE_VPHYSICS ), and <page>Entity:SetCollisionBounds</page>( mins, maxs ).</note>⤶ ⤶ <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>⤶ </description>⤶ <realm>Shared</realm>⤶ <args>⤶ <arg name="mins" type="Vector">The minimum position of the box. This is automatically ordered with the maxs.</arg>⤶ <arg name="maxs" type="Vector">The maximum position of the box. This is automatically ordered with the mins.</arg>⤶ </args>⤶ <rets>⤶ <ret name="" type="boolean">Returns true on success, nil otherwise. This fails when the game cannot create any more <page>PhysCollide</page>s.</ret>⤶ </rets>⤶ </function>⤶ ⤶