[SOLVED] What is the proper way to add script to the library?

I wanted to add tween to my project, here is what the tutorial says:

https://developer.playcanvas.com/en/tutorials/tweening/

To use the library just upload the tween.js file to your project. This will allow you to tween Entity properties like position, rotation, scale etc like so:

so I created the js file called tween.js and paste the whole content to the tween.js

and i got some error at start:
tween.js line.2 Uncaught ReferenceError: c is not defined

I think there is something wrong with my steps but I didn’t know what’s that

I’m a little confused as to why you created a new script and then C/P ed the contents. Why not just upload tween.js after downloading the repository? Alternatively, you could use the tutorial project and download all required tween library scripts from there. I hope this helps @potatoInHouse.

1 Like

thanks i think the problem has solved, it is very stupid

when I copy and paste the content, I lost a ‘p’ at the first line, so it becomes “c.extend” instead of “pc.extend”

thanks anyway I am a very stupid house potato

1 Like

Happens to all of us. Personally, I find it much easier to avoid errors by downloading and uploading instead of copy pasting.