Jump to content
Search Community

Number Counter Issue

Romiar test
Moderator Tag

Recommended Posts

Hi.

 

I have a strange issue with TweenMax.

I'm trying to create a counter with TweenMax and when i launch the code, in the update i have these values:

70704
index.ts:17 97500
index.ts:17 129511
index.ts:17 160944
index.ts:17 191799
index.ts:17 -209185
index.ts:17 -179452
index.ts:17 -150297
index.ts:17 -123385
index.ts:17 -95352
index.ts:17 -67897
index.ts:17 -42585
index.ts:17 -16252
index.ts:17 9503
index.ts:17 33215
index.ts:17 57848
index.ts:17 80504
index.ts:17 104015
index.ts:17 126948
index.ts:17 149303

 

can you help me?

 

I'm using this code:

var counter = { var: 0 };
TweenMax.to(counter1, {
    var: "1000000"
    onUpdate: function () {
        console.log(Math.ceil(counter.var));
    }
});
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...