Pc.events.attach is gone in version 2.1.0

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?

Thank you,

Extend from EventHandler or create an instance to use in the class engine/src/core/event-handler.js at 1585f01029641789dab8e06200854d036caa169e · playcanvas/engine · GitHub

Or you can re-add the logic that it used to do it yourself: engine/src/core/events.js at 36c482649b938188417ea9151f4af37ff26e12a0 · playcanvas/engine · GitHub

1 Like

A post was split to a new topic: SketchFab asset store isn’t working