Garry's Mod Wiki

Revision Difference

Entity:PhysicsInitSphere#518317

<function name="PhysicsInitSphere" parent="Entity" type="classfunc"> <description> Makes the physics object of the entity a sphere. <note>This function will automatically destroy any previous physics objects and call <page>Entity:SetSolid</page>( SOLID_BBOX ) and <page>Entity:SetMoveType</page>( MOVETYPE_VPHYSICS ).</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="radius" type="number">The radius of the sphere.</arg> <arg name="physmat" type="string">Physical material from [surfaceproperties.txt](https://github.com/Facepunch/garrysmod/blob/master/garrysmod/scripts/surfaceproperties.txt) or added with &lt;page&gt;physenv.AddSurfaceData&lt;/page&gt;.</arg> <arg name="physmat" type="string">Physical material from [surfaceproperties.txt](https://github.com/Facepunch/garrysmod/blob/master/garrysmod/scripts/surfaceproperties.txt) or added with <page>physenv.AddSurfaceData</page>.</arg> </args> <rets> <ret name="" type="boolean">Returns true on success, false otherwise</ret> </rets> </function>