How can I set weapon material?


function SWEP:PreDrawViewModel( vm, wep, ply )
	self:SetMaterial("Models/effects/splodearc_sheet")
end


It’s not work?

I don’t know why!!??

How can I set weapon material and set Default material ?

please teach me :frowning:

try: vm:SetMaterial() instead.

It still doesn’t work :frowning:

You sure the folder is named “Models” and not “models”?

Doesn’t work is not helpful. Post what happens and what you expect to happen, add screenshots if needed. ( Upload to imgur.com if you don’t know where )

yes I sure

https://github.com/garrynewman/garrysmod/blob/master/garrysmod/lua/weapons/weapon_fists.lua
It’s weapon Fists

As you can clearly see in that code, SetMaterial is already used to hide the original hands so the system can use player model hands without overlapping the base hands.

oh!!
so I should Set hands material !

can you teach me? thx :slight_smile:

[editline]25th May 2014[/editline]

oh I know !


 function GM:PlayerSetHandsModel( ply, ent )

	local simplemodel = player_manager.TranslateToPlayerModelName( ply:GetModel() )
	local info = player_manager.TranslatePlayerHands( simplemodel )
	if ( info ) then
		ent:SetModel( info.model )
		ent:SetSkin( info.skin )
		ent:SetBodyGroups( info.body )
		ent:SetMaterial("Models/effects/splodearc_sheet")
		end

	end

end

But it not transparent @@