Jump to content

Change Color Material


Go to solution Solved by gamecreator,

Recommended Posts

Posted

image.png.109a1da166df10030034d95f3eec1586.png

 

I want to change the color of the eye material, however it applies to all models. And the script is only attached to a single mesh of the robot.

Any suggestions?

 

		 local surface = self.entity:GetSurface(0) 
        
        --Get the surface material
        local material = surface:GetMaterial()

		material:SetColor(1,0,0)

 

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games

Posted
local enemy = Model:Load("Models/Characters/Player/Yue.mdl",1)

local amarillo = Material:Load("Models/Characters/Player/Negro.mat",1)
amarillo:SetBlendMode(Blend.Solid)
enemy:SetMaterial(amarillo)

image.png.92173de244f1b5a3a6b8b4c9a3b9f144.png

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...