求教,3.4设置父节点问题

文档链接:创建和销毁节点 · Cocos Creator

let scene = director.getScene();
        let node = instantiate(this.target);

        node.parent = scene;
        node.setPosition(0,0,0);

无法设置父节点
node.parent为Node类型 scene为 Scene类型

import { director } from ‘cc’;
// This will help you to get the Canvas node in scene
director.getScene().getChildByName(‘Canvas’);

谢谢—