How to pause animation?

1. A concise explanation of the problem you’re experiencing.

I want to pause my model animation,Even if timeline is still playing

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

var startTime = Cesium.JulianDate.now();
var animation = model.activeAnimations.add({
  name : 'model',
  startTime : startTime,
  stopTime : Cesium.JulianDate.addSeconds(startTime, 10, new Cesium.JulianDate()),
});

``

I tried this code,It can make the model stop playing after 10 seconds,But I don’t know how to continue playing,What should I do?

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

4. The Cesium version you’re using, your operating system and browser.

If you want the animation to keep playing, don’t include a start or stop time, and set it to loop. Let me know if that works.

What kind of project are you working on?

Hi Omar

Thanks for your response,my project is working on cargo airport,and this is my model:

https://sandcastle.cesium.com/?src=Hello%20World.html&label=Showcases&code=eyJjb2RlIjoiLy8gR3JhbnQgQ2VzaXVtSlMgYWNjZXNzIHRvIHlvdXIgaW9uIGFzc2V0c1xuQ2VzaXVtLklvbi5kZWZhdWx0QWNjZXNzVG9rZW4gPSAnZXlKaGJHY2lPaUpJVXpJMU5pSXNJblI1Y0NJNklrcFhWQ0o5LmV5SnFkR2tpT2lKbE1qa3pNemt4WWkxaU0yTTJMVFE0TlRrdE9ESm1OaTFoT1dObU5tUmtNV1V5WlRnaUxDSnBaQ0k2TXpVM0xDSnBZWFFpT2pFMU1qVXlNalEyTXpGOS5sWERuT29xVjhhZS1aZGk1QmczMEp6WVBQVmpqMG1JR1JON0pFcTNNc2RnJztcblxudmFyIHZpZXdlciA9IG5ldyBDZXNpdW0uVmlld2VyKCdjZXNpdW1Db250YWluZXInKTtcblxudmFyIHByb21pc2UgPSBDZXNpdW0uSW9uUmVzb3VyY2UuZnJvbUFzc2V0SWQoODA4NTMpXG4gICAgLnRoZW4oZnVuY3Rpb24gKHJlc291cmNlKSB7XG4gICAgICAgIHZhciBlbnRpdHkgPSB2aWV3ZXIuZW50aXRpZXMuYWRkKHtcbiAgICAgICAgICAgIHBvc2l0aW9uOiBDZXNpdW0uQ2FydGVzaWFuMy5mcm9tRGVncmVlcygwLCAwLCAxMDApLFxuICAgICAgICAgICAgbW9kZWw6IHtcbiAgICAgICAgICAgICAgICB1cmk6IHJlc291cmNlXG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICB2aWV3ZXIudHJhY2tlZEVudGl0eSA9IGVudGl0eTtcbiAgICB9KVxuICAgIC5vdGhlcndpc2UoZnVuY3Rpb24gKGVycm9yKSB7XG4gICAgICAgIGNvbnNvbGUubG9nKGVycm9yKTtcbiAgICB9KTtcbiIsImh0bWwiOiI8c3R5bGU+XG4gICAgQGltcG9ydCB1cmwoLi4vdGVtcGxhdGVzL2J1Y2tldC5jc3MpO1xuPC9zdHlsZT5cbjxkaXYgaWQ9XCJjZXNpdW1Db250YWluZXJcIiBjbGFzcz1cImZ1bGxTaXplXCI+PC9kaXY+XG48ZGl2IGlkPVwibG9hZGluZ092ZXJsYXlcIj5cbiAgICA8aDE+TG9hZGluZy4uLjwvaDE+XG48L2Rpdj5cbjxkaXYgaWQ9XCJ0b29sYmFyXCI+PC9kaXY+XG4ifQ==

I want to pause for a while when my vehicle is up, and then descend when I need it.set it to loop may not be what I need

在 2020年3月10日星期二 UTC+8下午8:37:08,Omar Shehata写道:

You can set the animation to pause/stop at any time. Here’s a Sandcastle that shows how to play and stop by clicking the buttons int he top left.

For your use case, it might be better to have two separate animations defined in your glTF, one that goes up, and one that goes down, so you can play the one you need without having to manually pause it at the right moment.