Model lightmap not changing

hi, I want to change the model from html buttons here is my code
HtmlHandler.attributes.add(‘a’, {
type: ‘asset’,
assetType: ‘render’
});

HtmlHandler.attributes.add(‘b’, {
type: ‘asset’,
assetType: ‘render’
});

HtmlHandler.attributes.add(‘c’, {
type: ‘asset’,
assetType: ‘render’
});

var buttons = document.querySelectorAll(‘.v1’);
// if found

 buttons.forEach(function (button, i) {
    button.addEventListener('click', function (e) {
        var obj = pc.app.root.findByName('box');
        
        if (obj && obj.render) {
    
            obj.render.asset = self.a;
            
        }
        
    });
});

it is change the model once time manual what should i do plz help?

Hi @ateeque,

What do you mean it is change once time manual? Can you elaborate?

when i click the button it was changing the model once because I didnt use the loop so that problem was that is solved now the remaining issue is that

i am creating a vinity configurator and for UI i am using html&css
i have three types of shelf model and each have different matrial like lightmap etc
when i change the model it is changing but how can i change the the model lightmap here is video.

If you are using PlayCanvas runtime lightmaps, you need to regenerate them. There are several topics around the forum, do a quick search, for example: