I have this action
Sprite > set angle > lerp(Sprite.Angle, 0, 0.05 * dt * 60)[/code:vzzk5gtg] which basically decelerate angle of the sprite towards 0. How to make it work the other way, so the sprite angle would slowly accelerate?
Just invert Sprite.Angle and 0 ?
Should work but I think this question was too easy. I must have missed something.
Try unlerp.
Sprite > set angle > unlerp(Sprite.Angle, 0, 0.05 * dt * 60)
That doesn't work. In the example the brick falls to the angle 90. When I use unlerp it does nothing. How can I accelerate it to the angle 90?
Develop games in your browser. Powerful, performant & highly capable.
You shouldn't use lerp with angles, because it isn't aware of cycles. See anglelerp. I don't think lerping is the correct way to do this anyway, since you basically want the rotate behavior with an acceleration, which doesn't involve any lerping.
FYI see also Using lerp with delta-time.