Skip to content

V3: reorganize the scripts folder #10104

Open

Description

@mvaligursky

Problem

The engine's scripts folder, published in the npm package as playcanvas/scripts/*, mixes two generations of scripts:

  • ESM scripts (scripts/esm/, about 45 files) are the modern, maintained set: camera controls and character controllers, XR, gsplat effects, camera frame, sky, water and more. Most are flat in scripts/esm/, and some are grouped in subfolders (gsplat, xr, vat, parsers).

  • Classic scripts (scripts/camera, physics, posteffects, utils, animation, textmesh, spine) are older pc.createScript scripts. Some are superseded:

    Others have no ESM equivalent: follow and tracking cameras, vehicle and physics helpers, cubemap renderer, text mesh, tween.

The modern scripts sit one level below the old ones, and it isn't clear which set to use.

Proposal

The specifics are to be decided:

  • Make the ESM scripts the main set, at the top of scripts/, organized in subfolders by area (for example camera, xr, gsplat, effects, parsers).
  • Remove the classic scripts. Port the ones that are still useful and have no ESM equivalent, and drop the ones that are superseded (the post effects go with V3: remove legacy post-processing (PostEffect / PostEffectQueue) #10091).
  • Update the references to the old paths: engine docs comments, examples, and the user manual (developer site).

Tracked in #10083.

Activity

  1. Maksims commented on Nov 20, 2026

    @Maksims
    Collaborator

    Removing classic scripts can lead to some problems. Specifically for users who use classic scripts as main script format. Adding ESM scripts to Editor's project will switch the way engine is loaded and scripts are loaded, and often it breaks many things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    V3Work for V3 engine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions