Can you tag a mesh instance in a model?

Dear community,

I have a real stumper. I am trying to integrate the refraction from this PlayCanvas 3D HTML5 Game Engine with AR, and I am getting so close, but one real is taht what I would like to use as the refractor is a mesh instance in the model. The code is written such that it looks for a tag called refract which I can only apply to the full model. IS there a way to tag the mesh instance?

Thanks,

B

Hi @groupsjrBrianDouglas,

No you can’t tag mesh instances, they are not part of the scene graph. But mesh instances can contain a pc.GraphNode which can be tagged, still I wouldn’t go with that approach here.

Another thing you can do is instead of using the legacy Model component, enable Import Hierarchy in your project and reimport your models as render components.

This way your model mesh instances will be split in separate components that you can then selectively tag.

Check this page on how that works:

https://developer.playcanvas.com/en/user-manual/assets/import-pipeline/import-hierarchy/

1 Like

That does help, but I am still getting an error that I just don’t understand as I did not write the refraction code.
Screen Shot 2021-11-30 at 11.34.49 AM