More accurate animation playback speed

This commit is contained in:
JannisX11 2023-04-30 00:45:37 +02:00
parent 2ca0ef9712
commit facc672f4a
2 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@ Animator.MolangParser.global_variables = {
'true': 1,
'false': 0,
get 'query.delta_time'() {
let time = (Date.now() - Timeline.last_frame_timecode + 1) / 1000;
let time = (Date.now() - Timeline.last_frame_timecode) / 1000;
if (time < 0) time += 1;
return Math.clamp(time, 0, 0.1);
},

View File

@ -501,8 +501,8 @@ const Timeline = {
if (Animation.selected.loop == 'hold') {
time = Math.clamp(time, 0, Animation.selected.length);
}
Timeline.setTime(time);
Timeline.last_frame_timecode = Date.now();
Timeline.setTime(time);
} else {
if (Animation.selected.loop == 'loop' || BarItems.looped_animation_playback.value) {