I have been using pc.events.attach(myClassInstance) for my projects to listen to some events from pc or custom events I created, but after upgrading Playcanvas to version 2.1.0. It doesn’t seem to work and I noticed whole pc.events is gone. Is there any alternative to do the same thing?
Is tween.js no longer supported in PlayCanvas Engine v2.x?
When trying to use tween.js in my PlayCanvas project, I encounter the following error:
Uncaught TypeError: Cannot read properties of undefined (reading ‘attach’).
The relevant code snippet is: pc.events.attach(this);
To verify that the issue is not specific to my project, I tested it using the official PlayCanvas tutorial for Tween.js and encountered the same error: https://playcanvas.com/project/452634/overview/using-the-tween-library
This raises the question: Is tween.js no longer supported in PlayCanvas Engine v2.x, or has its implementation changed?
Apologies we are still in the process of updating all of our supporting libraries to support Engine v2. I would recommend staying on Engine v1 for now and we will update you once Tween is compatible with Engine v2.
@jro The playcanvas-tween library has been updated now to work with V2. You can either grab the latest from the repo or import it again from the asset store. Drop me a message on Discord if you’re having any issue