akshay
1
Hi,
I am trying to create array attributes.
There are two problems,
I) I added the numbers in order 600, 1000, 300 but visually it is as shown below. However I get it properly ordered in code.
![](//forum-files-playcanvas-com.s3-eu-west-1.amazonaws.com/original/2X/a/a1fe18bbc5bbe5c0e888881cd7a953f1a99c011c.png)
II) How do I declare array of numbers? This is how I see in the inspector.
![](//forum-files-playcanvas-com.s3-eu-west-1.amazonaws.com/original/2X/e/ea4c5bbea3ee95800554b2d28f8e42285181f18d.png)
Code:
Test.attributes.add(‘step_delays’, {
type: ‘number’,
array: true
});
Thanks.
Martin
2
hey akshay,
I think you have to wait a bit to be able to use number arrays, as its not implemented yet.
Max wrote about it a couple of days ago in another thread:
http://forum.playcanvas.com/t/new-script-attributes-array-true/2291/2?u=martin
A tmp solution might be to use the string set and convert it into an internal number array in your initialize function.
Greetings,
Martin
2 Likes