When using LeanTween for Unity to move a GameObject, is it possible to set the in and out parts of the easing separately?
What I would like to do is:
- Start off slow.
- Gradually increase speed from slow to fast.
- Stop abruptly with no ease at the end.
When using LeanTween for Unity to move a GameObject, is it possible to set the in and out parts of the easing separately?
What I would like to do is:
On
What you describe sounds like Ease-in-sine, like so:
LeanTween.move(this.gameObject, new Vector2(0f, 5f), 2f).setEaseInSine();
This moves the gameobject the way you describe it: Slowly starting, accelerating and abruptly stopping.
When typing ".setEase", your IDE should suggest you ways to complete the code (See Screenshot). There you will find many different presets of easing-curves. Like only easing in, only easing out, or both combined. If you are not sure what easing to use, you can look at a collection of some of the most used easing-curves here: https://easings.net/en
Like @Lotan already suggested, creating your own animation curves would give you the ability to fully customize the easing behavior.
Maybe you should make your own animation curve on LeanTween.
Just create a
AnimationCurveto edit in the editor: