So, i have a prop entity i’m trying to rotate semi-smoothly.
I have a function that attempts to rotate the thing 120 degrees every time it’s called:
function ENT:SpinLeftSmoke() local angs = self.SmokeStack_L:GetAngles() timer.Create("left",.1,3,function() self.SmokeStack_L:SetAngles(Angle(angs.pitch +40,angs.yaw,angs.roll)) angs = self.SmokeStack_L:GetAngles() end) end
The first time the function is called, it works just fine, the prop rotates 120 degrees.
But when i call it a second time after, the Prop rotates 120 degrees in the opposite direction.
This pattern follows as i continuously call the function, 120 forward, 120 backwards, etc.
can’t figure out why it’s doing that.