I wanted to write scripts in the now recommended ESM format for newly written scripts for the first time today and wondered, why the parameters in some of my scripts are not listed in the editor. While digging into the issue I tried to follow the examples in the documentation closely without success.
Finally I found out that in the description of the Attribute types the general JavaScript types “number", “string" and “boolean" need to be written with capital first letters as “Number", “String" and “Boolean”. Please update the documentation.
And I found out that the attributes Vec2 , Vec3 , Vec4 , Entity , Asset or Color can’t just be written as strings in the editor. The type declarations are PlayCanvas types and need to be imported into the script first before they can be used. It would be very helpful to clearly note in the documentation that the PlayCanvas types need to be imported and to extend the documentation with code examples like the following to remind people new to PlayCanvas coding, that certain types need to be imported: