Skip to content

Commit ed22c76

Browse files
faverisvanifatovvlad
authored andcommitted
Fixed start time when normalized time is not zero
1 parent dbce206 commit ed22c76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Runtime/Scripts/MeshAnimationAssetExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static void Play(this MeshAnimationAsset asset,
3535
var length = data.lengthFrames;
3636
var s = speed / Mathf.Max(data.lengthSeconds, 0.01f);
3737
var time = normalizedTime.HasValue
38-
? Time.timeSinceLevelLoad + Mathf.Clamp01(normalizedTime.Value) * data.lengthSeconds
38+
? Time.timeSinceLevelLoad - Mathf.Clamp01(normalizedTime.Value) / s
3939
: block.GetVector(AnimationTimeProp).z;
4040

4141
block.SetFloat(AnimationLoopProp, data.looping ? 1 : 0);

0 commit comments

Comments
 (0)