Cloud Code JS Authoring tool from the Editor - Officially Released!

8941677--1226634--rw-2.gif

Welcome to the Cloud Code JS Authoring tool from the Editor discussion thread. You can use this thread to ask for help, share feedback and have discussions about the com.unity.services.cloudcode@2.1.1 package and the new feature enabled by the com.unity.services.deployment@1.0.0. This is the next step from our previous pre-release announcement.

Introduction

Introducing a new feature to Cloud Code to author it more easily! We are happy to bring all of the workflows you use on the Unity Dashboard to the Unity Editor!

With Cloud Code Authoring you do not have to leave the Unity Editor more than you need to, it allows you to:

  • Author and modify the Cloud Code JS scripts in the Editor.
  • Use the source control of your choice as a source of truth.
  • Deploy your assets from the Editor manually or by simply entering Play Mode!
  • Increment faster!

To get started please follow Script authoring within the Unity Editor.

Note: This feature is also available for Remote Config .

Requirements

  • This feature is only available Unity Editor 2021.3+
  • To use this feature you need to get the com.unity.services.deployment@1.0.0 package and the com.unity.services.cloudcode@2.1.1.

Feedback

At Unity, we put the Users First so your feedback is extremely valuable to us. Please share your feedback in this thread so that we can continue improving our tools for you!

How to report bugs

Ideally we’d like any bugs reported through the built in bug reporter tool, as that will automatically provide us with some relevant context.

Once you have submitted a bug report through the bug reporter, please feel free to start a discussion about it in this thread.

Thank you for your interest, we’re looking forward to your feedback!

4 Likes

I have some js scripts already in my project but it doesn’t appear in the deploy window and dragging the scripts into the window doesn’t add them to the list.

I then created new cloud code js scripts from the create menu and copied over the code and the scripts did appear in the deploy window but the next time I opened the editor the deploy window was empty again.

Please add a way to deploy existing files.

Unity 2022.2.12
deployment 1.0.0
cloud code 2.3.1

Hi Spinaljack,

What extension do they have?

Can you try right clicking on those assets, and reloading them? Reloading assets is necessary for them to be recognized as part of the deployment window.

Restart the editor and let me know if the assets remain in the window, if not we’ll create a ticket and investigate more deeply.

Cheers!

Restarting the editor clears the list and makes it blank.

Right clicking the .js files and reimporting did add them to the list.
Would prefer a refresh button on the window itself and keep the files in the list after a restart.

Hey Spinaljack,

The scripts should stay in the list. When you say it is blank, do you mean fully empty or is there a warning/other message this is displayed? Also have you by any chance reset the scripts meta files between reimport and it going blank?

The list is empty, there’s no error. I just close unity and reopen it.

Would you mind posting a screenshot?

After Restart:

After reimport:

Hey Spinaljack,

Just wanted to let you know that we have identified the bug that you are experiencing. We will be working quickly to fix the issue as this is not intended behavior. We will let you know as soon as a fix is available.

1 Like

Also I don’t see a way to add parameters to the cloud code being uploaded and I have to manually add them in the dashboard. How do I add parameters from inside the editor?

For this, you can declare directly within your script, following these guidelines: https://docs.unity.com/cloud-code/en/manual/scripts/authoring-scripts-editor#Declare_parameters_in_the_script

Make sure to initialize the JS Project first:

In the Unity Editor, select Edit > Preferences… > Cloud Code > “Initialize JS Project”

Referencing here the quick example in-script:

module.exports = async ({ params, context, logger }) => {
    return {
        "value": params["aParam"]
    };
};

module.exports.params = { "aParam" : { "type": "String", "required": true } }

Hey Spinaljack,

I am happy to say that we have been able to find and fix the bug that you encountered. Thanks again for reporting this. If you update your packages:

Deployment: 1.0.1
Cloud Code: 2.3.2

You should notice that the files are now always visible in the deployment window. Please give it a try and let us know if this works for you.

Deploy window properly shows my files now

2 Likes

This is great feature for cloud code!

I hope there will be support for C# modules inside editor soon so that its can auto deploy to cloud code services without build and deploy with ugs CLI :smile:

The new link for CloudeCode doc is here: https://docs.unity.com/cloud-code/en/manual/scripts/how-to-guides/write-scripts/deployment-window
Or CloudCode JS => How To => Write scripts => Using Unity Editor Deployment Window