[SOLVED] Vector attribute is not editable in inspector in script 2.0

Hi,

In the older scripting the vector attribute in the inspector would look like the following

for the part of the code
pc.script.attribute(‘pivot1’, ‘vector’);
pc.script.attribute(‘pivot2’, ‘vector’);

But in script 2.0, the following is seen in inspector

for the part of the code
Joint.attributes.add(‘pivot1’, { type: “vector”, default: [0,0,0] });
Joint.attributes.add(‘pivot2’, { type: “vector”, default: [0,0,0] });

So how to make the vector editable in the inspector in script 2.0?
In the older one it was editable in inspector but in new its not editable. Please resolve.

There is no longer a vector type. Try vec3, vec2 or vec4 instead. See the possible values for args.type here http://developer.playcanvas.com/en/api/pc.ScriptAttributes.html .

2 Likes