# I need a custom parameters accessible from Editor

**URL:** <https://forum.babylonjs.com/t/i-need-a-custom-parameters-accessible-from-editor/25650>\
**Category:** Questions\
**Tags:** editor\
**Created:** [November 30, 2021, 7:20am UTC](https://forum.babylonjs.com/t/i-need-a-custom-parameters-accessible-from-editor/25650 "2021-11-30T07:20:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Reza\_B](https://avatars.discourse-cdn.com/v4/letter/r/ce7236/32.png) [@Reza\_B](https://forum.babylonjs.com/u/Reza_B)\
**Post date:** [November 30, 2021, 7:20am UTC](https://forum.babylonjs.com/t/i-need-a-custom-parameters-accessible-from-editor/25650/1 "2021-11-30T07:20:15Z")

</div>

I need a custom parameters accessible from the editor but exportScript doesn’t work  
this is my code :

```auto
import { Node, Color4,Scene } from "@babylonjs/core";

export default class MyScript extends Node {
    public blackColor = new Color4(0, 0, 0, 1);

    protected constructor() { }

    public onInitialize(): void {
        // ...
    }

    public onStart(): void {
        // ...
    }

    public onUpdate(): void {
        // ...
    }

    public onMessage(name: string, data: any, sender: any): void {
        switch (name) {
            case "myMessage":
                // Do something...
                break;
        }
    }

    
}

exportScript(
    MyScript, 

    { blackColor: new Color4(0,0,0,1) }
);

```

in the vscode, the exportScript function has a error “Cannot find name 'exportScript '”

editor version : v4.0.4

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [November 30, 2021, 12:02pm UTC](https://forum.babylonjs.com/t/i-need-a-custom-parameters-accessible-from-editor/25650/2 "2021-11-30T12:02:36Z")

</div>

pinging @julien-moreau

---

<div class="post-metadata">

**Author:** ![julien-moreau](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/julien-moreau/32/12070_2.png) [@julien-moreau](https://forum.babylonjs.com/u/julien-moreau)\
**Post date:** [November 30, 2021, 6:33pm UTC](https://forum.babylonjs.com/t/i-need-a-custom-parameters-accessible-from-editor/25650/3 "2021-11-30T18:33:30Z")

</div>

Hi @Reza_B !

The way to export scripts and custom properties has changed from v3 to v4: the version 4 is now using decorators. More informations here: [Editor/attaching-scripts.md at master · BabylonJS/Editor · GitHub](https://github.com/BabylonJS/Editor/blob/master/doc/04%20-%20attaching-scripts/attaching-scripts.md#customizing-scripts-in-editor)

Your script should become something like:

```auto
import { Node, Color4,Scene } from "@babylonjs/core";

// The path can change according to where your script is located
import { visibleInInspector } from "../decorators.ts";

export default class MyScript extends Node {
    // Decorate the property using @visibleInInspector
    @visibleInInspector("Color4", "Black Color", new Color4(0, 0, 0, 1))
    public blackColor = new Color4(0, 0, 0, 1);

    protected constructor() { }

    public onInitialize(): void {
        // ...
    }

    public onStart(): void {
        // ...
    }

    public onUpdate(): void {
        // ...
    }

    public onMessage(name: string, data: any, sender: any): void {
        switch (name) {
            case "myMessage":
                // Do something...
                break;
        }
    }
}

```

Once your script is saved, the Editor will update its interface in the “Inspector” panel to show you the new field that can be edited.

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [December 29, 2021, 1:53pm UTC](https://forum.babylonjs.com/t/i-need-a-custom-parameters-accessible-from-editor/25650/4 "2021-12-29T13:53:31Z")

</div>

Hi @Reza_B just checking in, were you able to get your custom parameters?
