Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

excuse me,I can't get "object.x" in onUpdate callback #402

Closed
zhaoqize opened this issue Jan 4, 2018 · 3 comments
Closed

excuse me,I can't get "object.x" in onUpdate callback #402

zhaoqize opened this issue Jan 4, 2018 · 3 comments

Comments

@zhaoqize
Copy link
Contributor

zhaoqize commented Jan 4, 2018

  • tween.js version is 16.3.5

according to user_guide,I try to use it。

tween.onUpdate(function(object) {
	console.log(object.x);
});

But I can not get value of object.x,it print undefined in console。
like this: https://codepen.io/zhaoqize/pen/baqgjq?editors=1111

Is not that what I wrote?

thanks!

@dalisoft
Copy link
Collaborator

dalisoft commented Jan 4, 2018

Hi @zhaoqize
I see some guides was not updated.
FYI, there main package npm path was updated from tween.js to @tweenjs/tween.js

Change tween.js in config from
https://cdnjs.cloudflare.com/ajax/libs/tween.js/16.3.5/Tween.min.js
to
https://unpkg.com/@tweenjs/tween.js

And your pen should work fine

@zhaoqize
Copy link
Contributor Author

zhaoqize commented Jan 5, 2018

Wow, thank you very much!

The result is the same as I expected。

@BalconyFarmer
Copy link

npm install @tweenjs/tween.js
2.
import TWEEN from "@tweenjs/tween.js";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants