How to pause the game with timeScale?

I am using Cocos Creator 3.2.0

Is there a way to pause the game using timeScale ?

I found following post but not sure how to implement this.

Can you provide some assistance on how to implement this?

add the function provided in that thread to your project and call it when you want to set the scale value.

I add it to typescript file.

But where should I declare variables _deltaTime and _lastUpdate?

They don’t seems to be declared in the file.

1 Like

But somehow its available at runtime. xD
It works.

@nicetry107 yes
you are correct

I add //@ts-ignore and it worked :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.