scripts/esm/README.md
A collection of ready-to-use Script classes for the PlayCanvas Engine, maintained and versioned alongside it, that attach to entities via the script component.
These scripts ship inside the playcanvas npm package but are not part of the core engine bundle — each one is imported directly from its module:
import { Vec3 } from 'playcanvas';
import { CameraControls } from 'playcanvas/scripts/esm/camera-controls.mjs';
entity.addComponent('script');
entity.script.create(CameraControls, {
properties: {
focusPoint: new Vec3(0, 1, 0)
}
});
Script attributes (documented on each class) can be passed via properties as above, or edited in the PlayCanvas Editor.