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 :
https://184.169.198.12/t/how-to-create-an-array-property/46074
also this is a wrong answer for new cocos creator version:
https://184.169.198.12/t/typescript-array-property/44578
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.