Attach decals to mesh as child

I am trying to attach decals to mesh so they can move (translate, rotate, scale) with the decal (which seems to be a very common use case), but setting decal.parent = mesh will not retain the pose of the decal.
I can’t find any working solution for translating pose online, any help will be appreciated!

Here’s the example of my problem:

https://www.babylonjs-playground.com/#1BAPRM#190

You need to call setParent (in order to keep the current transforms):
https://www.babylonjs-playground.com/#1BAPRM#191

Doc: Use a Parent - Babylon.js Documentation

1 Like

Thanks, it works like a charm! When I scanned through that document I didn’t find the difference between mesh.setParent() and mesh.parent. I would recommend to make it more clear in the document.

Do you mean in the code comments?

Yes, that’s a good place for more explanation

will do!