Garry's Mod Wiki

Garry's Mod Wiki

  DModelPanel:SetModel( string model )

Description

Sets the model of the rendered entity.

This function may give a different model than expected. This is not a bug, however this problem may appear with some player models which are renamed several times in a wrong way. To solve that, you can use Entity:SetModel and Entity:SetModelName on the internal panel entity. More information : https://github.com/Facepunch/garrysmod-issues/issues/4534.

Arguments

1 string model
The model to apply to the entity.

Example

Creates a new DModelPanel with the Kleiner playermodel.

local modelPanel = vgui.Create( "DModelPanel" ) modelPanel:SetPos( 0, 0 ) modelPanel:SetSize( 200, 200 ) modelPanel:SetModel( "models/player/kleiner.mdl" )
Output:
image.png

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...