I am trying to make an entity become larger over time.
I have tried dissecting the entire code down right to the simple SetModelScale
For some reason the entity never seems to change.
Any ideas on what is wrong:
[CODE]function ENT:Think()
--Plant Size is set to .1 in SetModelScale and SetPlantSize in Initialize
if self:GetPlantSize() <= 1 then
local newscale = self:GetPlantSize() * 2
self:SetPlantSize(newscale)
self:SetModelScale( newscale , 1 )
end
self:NextThink(CurTime()+1)
return true
end
[/CODE]
Interestingly enough this doesn't even work:
[CODE]function ENT:Think()
self:SetModelScale( self:GetModelScale() * 1.25, 1 )
end[/CODE]
What's the issue?
*edit* I feel that you can't continuously update this...I will set it when the ent spawns and go from there.
Sad because you can't work backwards that way... say to make it shrink again... If anyone has a solution to this It would be much appreciated.
EDIT EDIT:
After playing around with it, it seems that the second variable being something other than 0 breaks the code
this:
[CODE]function ENT:Think()
self:SetModelScale( self:GetModelScale() * 1.25, 0 )
end
[/CODE]
works perfect.
Is this broken in Garrysmod?
[code]
function ENT:Think()
self:SetModelScale( self:GetModelScale() * 1.25, 0 )
end
[/code]
Yea I can confirm this. If argument 2 is 0, then it'll work otherwise it won't.
Thanks.
Glad to know I am not the only one with the issue
Sorry, you need to Log In to post a reply to this thread.