func button

How can i make a wireframe material to the func_button?
I tried to make the code.


for k, v in pairs( ents.FindByClass( "func_button" ) ) do

	v:SetMaterial('models/wireframe')
	
end

But it does not work.

bump

Are you sure that you are referencing the right class? If you are trying to retexture a button spawned by the toolgun the class name is “gmod_button”.

Code works fine for me.

Yes, this is the right class
This buttons that were created by map

SetMaterial might not work on brush entities like it would with point/scripted ones.

I might have a look into it later.

EDIT

Doesn’t seem like the function works on brushes.

func_button is the entity that the player interacts with and is invisible over the top of the map drawn button which is just part of the map