求助,如何用cc.instantiate生成多个MotionStreak对象

var node1= this.node.getChildByName(“steak”);
var steak1= node1.getComponent(cc.MotionStreak);
steak1.reset();
是可以正常编译的。

现在,我想要生成多个MotionStreak对象,尝试用:

var node2 = cc.instantiate(node1);
var steak2= node2.getComponent(cc.MotionStreak);
steak2.reset(); 这里直接就报错了。ERROR: Uncaught TypeError: Cannot read property ‘reset’ of null

求助。。这个到底该怎么解决。

1赞

请问楼主解决了吗 我也碰到了