One more idea - are your meshes set to be preloaded? If not, and they’re not loaded in the first frame when the baking takes place, you might need to trigger the baking manually from script when those are loaded.
Updates @mvaligursky?
actually in your project! I saw that the light is still there but in my case I delete the object as like in other software light data is already baked and need it no more ,is that causing the trouble
The baking takes place at runtime, so when you run the game, the light needs to be there as its used to bake it on the first frame.
We don’t bake and store textures. You can bake externally in Blender and bring in your lightmaps if you want. But if you bake in PlayCanvas, the light needs to stay, but be configured for baking instead of realtime light. Or at least hybrid, where its used to bake some meshes (building) but also used at realtime for characters.
Maybe, but the difference is, that here the light map never looked correct. In the other example, the shadow data get’s lost, when baked a second time. Here it’s wrong the first time. https://playcanvas.com/editor/scene/1798748
When you set ‘Lightmapper Auto Bake’ to true. (In SETTINGS → EDITOR->‘Lightmapper Auto Bake’ )
It will bake at the start of the app automatically. So when you bake it by script it’s the second time by default. Also, lightmap will not work well with batch group.