How can i create an array property of Nods
this is not work for me:
@property({ type: Node })
player: Node[]=[];
[i dont want a dropdown selection, i need a array property with 4 element]
this question is not correct now :
also this is a wrong answer for new cocos creator version:
1 Like
I’ll ask engineering to help. What version are you using?
uosdev
#4
Try this one:
import { Node } from 'cc'; // Important: We have to import Node from cc module.
@property([Node])
arrayOfNodes: Node[] = []
Then in the editor, you will see this one.
You can change the number of arrays by change the value in the textbox. (In my screenshot it’s named: ArrayOfNodes)
1 Like
system
closed
#5
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.