• How Would I Go About Scaling an Entity?
    2 replies, posted
Hey, I'm wondering if anyone is able to help me with a lua issue I'm having. I have an entity created, with physics. I want it so that when it is created, it starts at a size of 1 then scales to a size 3 times as big over the course of 3 seconds. (Everything below is under my ENT:Initialize() function.) [lua]self:SetModelScale( self:GetModelScale() * 3, 3 )[/lua] Unfortunately, this doesn't do anything, and I'm told that the issue is that my entity has physics, so I tried sleeping it. [lua]local phys = self:GetPhysicsObject() if( IsValid( phys ) ) then phys:Sleep() self:SetModelScale( self:GetModelScale() * 3, 3 ) end[/lua] Again, no result. The weird thing is, if I set the duration of the scale to be 0, the entity scales properly. The takeaway from this is that the entity only scales on the first frame it is created, I can't seem to figure out how to have it scaled over a specified duration. Any and all help is appreciated.
Bump. Maybe there is another entity that someone could share with me as reference which performs this task?
math.approach should do the trick for 3 seconds?
Sorry, you need to Log In to post a reply to this thread.