# Potential wrong documentation info for "Enumeration attribute"

**URL:** <https://forum.playcanvas.com/t/potential-wrong-documentation-info-for-enumeration-attribute/35406>\
**Category:** Help & Support\
**Tags:** learning\
**Created:** [March 27, 2024, 7:23pm UTC](https://forum.playcanvas.com/t/potential-wrong-documentation-info-for-enumeration-attribute/35406 "2024-03-27T19:23:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gunner](https://forum.playcanvas.com/letter_avatar_proxy/v4/letter/g/258eb7/32.png) [@gunner](https://forum.playcanvas.com/u/gunner)\
**Post date:** [March 27, 2024, 7:23pm UTC](https://forum.playcanvas.com/t/potential-wrong-documentation-info-for-enumeration-attribute/35406/1 "2024-03-27T19:23:27Z")

</div>

Hi, It is mentioned in the Enumeration attribute section of the documentation that ‘vec3’ can be used as a type. Link: [Script Attributes | PlayCanvas Developer Site](https://developer.playcanvas.com/user-manual/scripting/script-attributes/#enumeration-attribute)

When i tried to use it in script, it shows this error:  
 ![Screenshot 2024-03-27 235547](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/6/9/69982a069ef6462f07f5f016f70c75c1c8994084.png)

My declaration:  
Test.attributes.add(‘enumTest’, {  
type: ‘vec3’,  
enum: [  
{ ‘one’: [0,1,2] },  
{ ‘two’: [1,0,2] },  
{ ‘three’: [2,0,1] }  
]  
});

---

<div class="post-metadata">

**Author:** ![Adrian\_Moore](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/adrian_moore/32/30422_2.png) [@Adrian\_Moore](https://forum.playcanvas.com/u/Adrian_Moore)\
**Post date:** [March 28, 2024, 1:09pm UTC](https://forum.playcanvas.com/t/potential-wrong-documentation-info-for-enumeration-attribute/35406/2 "2024-03-28T13:09:55Z")

</div>

Doesn’t look like its supported.  
Since the user doesn’t see the data behind each enum, one option is to change to string array of numbers. I’ve confirmed the following works

```js
Test.attributes.add('enumTest', {
    type: 'string',
    enum: [
        { 'one': '0,1,2' },
        { 'two': '1,0,2' },
        { 'three': '2,0,1' }
    ]
});

// initialize code called once per entity
Test.prototype.initialize = function () {
    const v = this.enumTest.split(',')
    const vec = new pc.Vec3(v[0], v[1], v[2])
    console.log(vec)

```

---

<div class="post-metadata">

**Author:** ![LeXXik](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/lexxik/32/6953_2.png) [@LeXXik](https://forum.playcanvas.com/u/LeXXik)\
**Post date:** [March 28, 2024, 1:16pm UTC](https://forum.playcanvas.com/t/potential-wrong-documentation-info-for-enumeration-attribute/35406/3 "2024-03-28T13:16:02Z")

</div>

Yep, the docs need an update.

P.S.  
You can also create a vector from array directly:

```js
const v = this.enumTest.split(',');
const vec = new pc.Vec3(v);

```

Created an issue:

> <https://github.com/playcanvas/editor/issues/1132>
>
> Forum: https://forum.playcanvas.com/t/potential-wrong-documentation-info-for-enu…meration-attribute/35406
> 
> The docs states that enum supports vectors, which is not correct:
> https://developer.playcanvas.com/user-manual/scripting/script-attributes/#enumeration-attribute
