Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Animation pause

Author
Message
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 3rd Feb 2018 22:17
Is there any smart way of pausing all 3D animations at once, and then resuming them all, from the pause point?
hoyoyo80
7
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 4th Feb 2018 04:26
put all of them into array? then stop?
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 4th Feb 2018 07:05
I think a single command would be ideal. Now the game has to do the following for each aninated model:

At pause:
- store the time of the animation
- stop the animation

At resume:
- set the animation again
- set again tbe time at the momment of pause
puzzler2018
User Banned
Posted: 4th Feb 2018 09:23
do

if getkeypressed(P)

repeat
show a Pause word
sync()
until getkeypressed(P)

endif
//main loop sync
sync()

loop
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 4th Feb 2018 10:31 Edited at: 4th Feb 2018 10:32
Puzler, the animations would still continue in your code.

Id suggest using SetObjectAnimationSpeed(0)

You can set the animation speed to zero (the documentation even states that this pauses the animation), then set the speed back to 1.0 when you want it to continue.
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 4th Feb 2018 20:07
Thank you Bengismo. I didn't think of your suggestion

Login to post a reply

Server time is: 2024-04-18 03:08:18
Your offset time is: 2024-04-18 03:08:18