Scripting
The PlayCanvas Editor provides a tightly integrated environment for writing and managing scripts. This section covers the Editor-specific tools and workflows that will enhance your scripting experience.
Learn the Basics First
If you're new to scripting in PlayCanvas, we recommend starting with the Scripting section to learn the fundamentals—script lifecycle, events, attributes, and the Engine API—before diving into the Editor-specific features covered here.
What the Editor Provides
As an Editor user, you benefit from a tightly integrated development environment:
- Asset Management — Scripts are assets, managed alongside your models, textures, and materials in the Assets panel.
- Visual Configuration — Script Attributes let you customize script behavior directly in the Inspector without changing code.
- Rapid Iteration — Hot Reloading lets you see code changes in real-time without restarting your app.
- Seamless Integration — The Editor bridges the gap between your code and your scene, making it easy to connect scripts to Entities and Components.
In This Section
- Managing Scripts — Create, organize, and manage script assets in the Editor.
- Import Maps — Configure module resolution for ESM scripts.
- Code Editor — Use the built-in code editor for quick edits.
- VS Code Extension — Set up VS Code for a full-featured development experience.
- Hot Reloading — Iterate rapidly with live code updates.
- Loading Order — Control the order in which scripts are loaded.