[]js中使用sharedMesh报错

我参照示例里面想给自己导入的3D模型添加控制器来增加点击事件,但是现在到这一步试运行就报错了。
代码:
    //仓库原型
warehouse1 = Laya.MeshSprite3D.load("model/warehouse/1.lh");
scene.addChild(warehouse1);
warehouse1.transform.rotate(new Laya.Vector3(0, 0, 0), false, false);
warehouse1.transform.translate(new Laya.Vector3(-25,0,0),false);
warehouse1.name = "仓库1";
var warehouseCollider1 = warehouse1.addComponent(Laya.MeshCollider);
warehouseCollider1.mesh = warehouse1.meshFilter.sharedMesh;
错误信息:

TypeError: Cannot read property 'sharedMesh' of undefined
at onComplete (file:///E:/LayaWorkspace/javaScriptLaya/src/warehouse.js:129:52)
at Handler.__proto.run (file:///E:/LayaWorkspace/javaScriptLaya/bin/libs/laya.core.js:693:26)
at ResInfo.onLoaded (file:///E:/LayaWorkspace/javaScriptLaya/bin/libs/laya.core.js:12657:28)
at EventHandler.__proto.runWith (file:///E:/LayaWorkspace/javaScriptLaya/bin/libs/laya.core.js:709:27)
at ResInfo.__proto.event (file:///E:/LayaWorkspace/javaScriptLaya/bin/libs/laya.core.js:479:28)
at LoaderManager.__proto._endLoad (file:///E:/LayaWorkspace/javaScriptLaya/bin/libs/laya.core.js:12775:11)
at Loader.onLoaded (file:///E:/LayaWorkspace/javaScriptLaya/bin/libs/laya.core.js:12752:10)
at EventHandler.__proto.runWith (file:///E:/LayaWorkspace/javaScriptLaya/bin/libs/laya.core.js:709:27)
at Loader.__proto.event (file:///E:/LayaWorkspace/javaScriptLaya/bin/libs/laya.core.js:479:28)
at Loader.__proto.endLoad (file:///E:/LayaWorkspace/javaScriptLaya/bin/libs/laya.core.js:12404:8) 
 

laya.png

类库也检查过了,应该是1.7.13beta
刚开始学习,有大牛帮忙看下吗,感激不尽!!!

wudi199553

赞同来自:

可能是你的mesh有问题,因为报错提示就是这个问题

要回复问题请先

商务合作
商务合作