Garry's Mod Wiki

Entity:PhysicsInitStatic

boolean Entity:PhysicsInitStatic( number solidType )

Description

Initializes a static physics object of the entity using its current model. If successful, the previous physics object is removed.

This is what used by entities such as func_breakable, prop_dynamic, item_suitcharger, prop_thumper and npc_rollermine while it is in its "buried" state in the Half-Life 2 Campaign.

If the entity's current model has no physics mesh associated to it, no physics object will be created.

This function will automatically call Entity:SetSolid( solidType ).
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

1 number solidType
The solid type of the physics object to create, see Enums/SOLID. Should be SOLID_VPHYSICS in most cases.

Returns

1 boolean
Returns true on success, false otherwise. This will fail if the entity's current model has no associated physics mesh.

Page Links


Special Pages


Wikis

?

Render Time: 43ms

DB GetPage 10
Generate Html 6
SaveChanges (1) 11
Render Body 0
Render Sidebar 13