How to get the correct material and texture asset id?


#1

Hi, I’ve tried to get the asset ID of the resources from an existing entity which has texture and material set up.

I can successfully get the resource id of the model and sound clip like this:
this.modelID = this.entity.model.asset;
this.soundID = this.entity.sound.slot(‘Slot 1’).asset;

but I got problems while I tried to get the resource id of the material and texture,
tihs is the code refering to mat & tex:

this.texID = this.entity.model.meshInstances[0].material.diffuseMap;

is there anything wrong with it?

thanks