Thursday, November 3, 2022
HomeGame DevelopmentUIMeshrenderer not working Cocos Creator 3.6 - Cocos Creator

UIMeshrenderer not working Cocos Creator 3.6 – Cocos Creator


Once I run my mission on cellular and alter the fabric of the 3D mannequin within the script then it disappears from the UI.

In Cocos Creator 3.5.2 it work nicely. I’m utilizing Cocos Creator 3.6.0


How did you modify the fabric? What did the fabric change to?

updateModel(knowledge: DataSkin) {

    let fashions = this.carModelContainer.getComponentsInChildren(MeshRenderer);

    // console.log(fashions, knowledge.materials);

    assets.load(knowledge.materials, Materials, (err, res) => {

        if (!err) {

            for (let j = 0; j < fashions.size; j++) {

                var mannequin = fashions[j];

                // mannequin.node.getComponent(UIMeshRenderer).enabled = false;

                mannequin.setMaterial(res, 0);

                // mannequin.node.getComponent(UIMeshRenderer).enabled = true;

            }

        }

    });

}

Right here is the code to vary the fabric. And the identical factor occurs while you set enabled of UIMeshrenderer = false and set to true after.

Once I hiding the second background all the things nicely works. I believe once I modified the fabric the 3d mannequin layer was hidden beneath the second background.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments