I've been trying to work out how to half the size of a sprite and then return it back to its' original size using lerp.
I've managed to get the sprite to increase and decrease in size using lerp. However, it doesn't seem to be increasing/decreasing by the right amount. It's probably some bad maths on my part, or just a wrong use of lerp ^^. Any help would be muchly appreciated.
Pseudo code:
On event:
- Trigger once whilst true --> set size to:
Width: lerp(Self.width,Self.Width/2,dt*self.scrollspeed)
Height:lerp(self.Height,self.Height/2,dt*self.scrollspeed)
Else:
- Trigger once whilst true --> set size to:
Width: lerp(Self.width,Self.Width*2,dt*self.scrollspeed)
Height:lerp(self.Height,self.Height*2,dt*self.scrollspeed)
Thanks for reading :)