Good Evening! How can I make a smooth blinking image? I thought to change image transparency by
LerpBlinking = Lerp(FrameTime(),LerpBlinking,255)
but I guess it is a bad idea
Usually math.sin/cos works best for this, but if you want some other interpolation method then you'll have to change it.
alpha = (math.sin(CurTime() * SPEED) + 1) * 255/2
math.sin returns a value between -1 and 1, use +1 to change that to between 0 and 2, multiply by 255/2 to get between 0 and 255
Thanks. Works amazing!
Sorry, you need to Log In to post a reply to this thread.