When an LSequence contains more than two LMotions using .BindToScale, the initial scale value of the first LMotion is not applied correctly.
Instead, the object initially appears at a scale close to Vector3.one, then immediately jumps to the expected starting scale and continues the animation on the next frame. However this does not happen if there is only one LMotion in a Sequence.
Expected behavior:
The object should start at the first LMotion's initial scale as soon as the sequence begins, without any visible frame at an incorrect scale.
Environment
- Latest LitMotion Version
- Unity 6.3
Describing the Bug in the Code:
We are basically starting the Scale of the Object from zero. But when this code runs, for the first frame the Object appears with scale close to 1. Before we call PlantGrow(), we make sure the scale of the object is set to zero and other necessary safety codes are written.
cube.transform.localScale = Vector3.zero;
PlantGrow(cube);
//Notice the huge time duration 100 seconds!!
//Any time duration value works, but 100 seconds helps easily visualize the BUG.
private void PlantGrow(GameObject cube)
{
LSequence.Create()
.Append(LMotion.Create(Vector3.zero, new Vector3(0.8f, 1.2f, 0.8f), 100.00f) //Notice the 100 Seconds here.
.WithEase(Ease.OutQuart)
.BindToLocalScale(cube.transform))
.Append(LMotion.Create(new Vector3(0.8f, 1.2f, 0.8f), new Vector3(1.1f, 0.95f, 1.1f), 0.2f)
.WithEase(Ease.OutQuad)
.BindToLocalScale(cube.transform))
.Run();
}
Steps to Reproduce the bug
- Open an Empty Unity Project
- Create an empty GameObject and drag and drop
Movement.cs (Present in Stuff.zip)
- Assign a cube Prefab with pivot in the bottom. (I have provided this).
- Run the game and Press the 'F' key. [New or Old Input System does not matter]
- Notice the object appearing suddenly.
https://youtu.be/FWKy7DUpjjY?si=uk1EtZgS57Hl9rfg
^Video Footage of the Bug
(Could not capture it in screen record btw)
Stuff.zip
When an
LSequencecontains more than twoLMotions using.BindToScale, the initial scale value of the firstLMotionis not applied correctly.Instead, the object initially appears at a scale close to
Vector3.one, then immediately jumps to the expected starting scale and continues the animation on the next frame. However this does not happen if there is only one LMotion in a Sequence.Expected behavior:
The object should start at the first
LMotion's initial scale as soon as the sequence begins, without any visible frame at an incorrect scale.Environment
Describing the Bug in the Code:
We are basically starting the Scale of the Object from zero. But when this code runs, for the first frame the Object appears with scale close to 1. Before we call PlantGrow(), we make sure the scale of the object is set to zero and other necessary safety codes are written.
Steps to Reproduce the bug
Movement.cs(Present in Stuff.zip)https://youtu.be/FWKy7DUpjjY?si=uk1EtZgS57Hl9rfg
^Video Footage of the Bug
(Could not capture it in screen record btw)
Stuff.zip