Entity/PhysicsInitBox

From Garry's Mod
Jump to: navigation, search
 Entity:PhysicsInitBox( )

Contents

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 Vector( -1, -1, -1 ) and Vector( 1, 1, 1 ), respectively.

NOTE

This function will automatically destroy any previous physics objects if successful and call Entity:SetSolid( SOLID_BBOX ), Entity:SetMoveType( MOVETYPE_VPHYSICS ), and Entity:SetCollisionBounds( mins, maxs ).

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.

Arguments

Vector mins

The minimum position of the box. This is automatically ordered with the maxs.

Arguments

Vector maxs

The maximum position of the box. This is automatically ordered with the mins.

Returns

boolean

Returns true on success, nil otherwise. This fails when the game cannot create any more PhysCollides.
Personal tools
Navigation