Need help with continuing method..

Discussion and help for Easy Save 3
Post Reply
Brandeno
Posts: 8
Joined: Sun Jan 10, 2021 9:42 am

Need help with continuing method..

Post by Brandeno »

Hi Everyone!

I’m having a little trouble

Using PlayMaker I'm invoking method which calls a coroutine when I hit a button. Once the coroutine is called a timer appears and counts down.

Now My question is; when I run the method and save the game if the timer is still running it when I load back up it doesn’t save the state and just ends the coroutine. Is it possible to continue where the coroutine left off and have the timer keep on going when the game is loaded back up?

The same thing happens when I try run the method through an OnClick() without playmaker. I'm so lost :(

Thanks!
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Need help with continuing method..

Post by Joel »

Hi there,

It wouldn't be possible to save the state of a coroutine because it's not serialisable at runtime. Instead you would need to save the elapsed time of the timer and then use this to restart the coroutine at that specific time.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Brandeno
Posts: 8
Joined: Sun Jan 10, 2021 9:42 am

Re: Need help with continuing method..

Post by Brandeno »

Hi Joel,

Oh! Thank you!! Appreciate the help!
Post Reply