Hi, I’m new to PlayCanvas.
When using Local Server, how can I import a new script to Editor?
Currently, I import a new script to Editor by creating the script on my local machine, clicking [Add Assets] → [New Script] on editor, creating a new script with same name as my local file, attaching this script to my entity and deleting this script on Editor.
Are there any better way to import scripts on the local machine to Editor?
You can create a git or mercurial repository on BitBucket or Github, and then connect your project with that repository. After you create a repository go to the CODE tab in your project’s dashboard, and click External Repo on the left. Then follow the instructions to sync to your repository.
The workflow then will be that you add a script in your computer, you commit the new script and push it, then you go to the CODE tab in the dashboard and hit Sync.
It’s worth noting that if you do use a repository for your code then you will no longer be able to use the PlayCanvas Editor for that project, you will have to edit your scripts locally on your favorite text Editor and when you’re done, commit, push and sync in the CODE tab.