Cannot update reflection texture of pbr material

Hello
I cannot reassign pbr materials. In the example below, I assigned a pbr to a sphere, and on the button click, a different pbr is assigned
The difference between materials is in reflactionTexture

I also tried to update the pbr material instead of recreating a new one, but still nothing gets updated.

Please let me know how I can update the pbr material or assign a new pbr material

Thank you

The first parameter you pass to CubeTexture is the (unique) name of the texture: if you pass the same name the 2nd time, it will just retrieve the texture created the first time. You should pass different names:

3 Likes

Thank you @Evgeni_Popov