Tomas Posted August 15, 2017 Posted August 15, 2017 Script.a=0 Script.mtl=NULL Script.srf=NULL function Script:Start() self.srf = self.entity:GetSurface(0); self.mtl=self.srf:GetMaterial() end function Script:UpdateWorld() self.mtl:SetColor(255,255,255,self.a) self.a=self.a+0.001 end That's the lua skydome code I have so far. It goes from transparent to solid, but theres no texture, just color. If I remove "SetClolor()" the texture is back to place. Any ideas? Quote
Tomas Posted August 15, 2017 Author Posted August 15, 2017 Finally sorted this out myself. That's the code now: Script.a=0 Script.mtl=NULL Script.srf=NULL Script.col=Vec4() function Script:Start() self.srf = self.entity:GetSurface(0); self.mtl=self.srf:GetMaterial() end function Script:UpdateWorld() self.col=self.mtl:GetColor() self.col.r = self.col.r self.col.g = self.col.g self.col.b = self.col.b self.col.a = self.col.a-self.a self.mtl:SetColor(self.col) self.a=self.a+0.0001 end Quote
Recommended Posts
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.