Why the mesh has been marked as non-accessible when adding MeshCollider from assetBundle and how to

35 篇文章 1 订阅

Why the mesh has been marked as non-accessible when adding MeshCollider from assetBundle and how to solve it?

https://stackoverflow.com/questions/59300945/why-the-mesh-has-been-marked-as-non-accessible-when-adding-meshcollider-from-ass

Asked 11 months ago

Active 11 months ago

Viewed 1k times

 

1

I have a scriptable asset containing a fxbModel on a GameObject variable and with it i'am doing this:

model = Instantiate(caAsset.model, origin);
fbxComponents.All(fbxComponent => fbxComponent.gameObject.AddComponent<MeshCollider>());

Is the asset loaded from Ressources, everything works well.*

But is the asset from a AssetBundle** the following error occurs.

CollisionMeshData couldn't be created because the mesh has been marked as non-accessible. 
Mesh asset path "" Mesh name "Flanschdeckel_low"
UnityEngine.GameObject:AddComponent()

(*)
MyScriptableAsset caAsset = Resources.Load(scriptableObjectName);

(**)
MyScriptableAsset caAsset = bundle.LoadAsset<MyScriptableAsset>(scriptableObjectName);

unity3d assetbundle accessible scriptable

share improve this questionfollow

edited Dec 12 '19 at 9:58

asked Dec 12 '19 at 9:01

row

6311 silver badge88 bronze badges

add a comment

1 Answer

 

1

There's a read/write enabled property on fbx files on the model tab under mesh sub text if you tick that box it'll probably work. Check right corner on image for better understanding.enter image description here

share improve this answerfollow

answered Dec 12 '19 at 11:21

rob1997

13655 bronze badges

  • Yes, that makes the trick. Thank you. I found out, that unity further has this checkbox checked on fbx import. I have not found a way to edit this setting, but with docs.unity3d.com/ScriptReference/Mesh-isReadable.html it is possible to control the process of creating asset bundles by informing the user who is creating the asset. – row Dec 12 '19 at 12:04

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值