The effect i've made (A simple laser so far) refuses to draw when looking at it from a specific location, so I guessed it was a render bounds problem, but somehow it doesn't change shit, and when i do
[lua]local a,b = self:GetRenderBounds()
print(a,b)[/lua]
It always outputs this no matter what i set self:SetRenderBounds(vec1,vec2) to :
[code]-1024.0000 -1024.0000 -1024.0000 1024.0000 1024.0000 1024.0000[/code]
So does anyone know what causes this?
What code are you using for setting the bounds?
This is my entire effect :
[lua]local SpriteMat = Material("wds/effects/blankparticle")
local LaserMat = Material("cable/redlaser")
local Col = Color(255,70,70,150)
function EFFECT:Init(d)
self.StartPos = d:GetStart()
self.EndPos = d:GetOrigin()
self.DieTime = CurTime()+0.3
self.Entity:SetRenderBoundsWS(self.StartPos,self.EndPos)
end
function EFFECT:Think()
return self.DieTime > CurTime()
end
function EFFECT:Render()
render.SetMaterial(SpriteMat)
render.DrawSprite(self.StartPos,15,15,Col)
render.SetMaterial(LaserMat)
render.DrawBeam(self.EndPos,self.StartPos,15,0,0,Col)
end[/lua]
I used this for my laser swep I made ages ago, and I put it in the render or draw function. Not the init. I don't know if it will work for you or not.
[lua]
v:SetRenderBoundsWS( pos, tr.HitPos, Vector() * 8 ) --No fuckin clue what the Vector()*8 is. I think I just copied that from where I got help.
[/lua]
Also, this was done clientside.
Sorry, you need to Log In to post a reply to this thread.