# Change HDRI cubemap on the fly

**URL:** <https://forums.unrealengine.com/t/change-hdri-cubemap-on-the-fly/474500>\
**Category:** Rendering\
**Tags:** hdri, unreal-engine, Scripting, question\
**Created:** [November 15, 2020, 12:19pm UTC](https://forums.unrealengine.com/t/change-hdri-cubemap-on-the-fly/474500 "2020-11-15T12:19:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Idantim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Idantim](https://forums.unrealengine.com/u/Idantim)\
**Post date:** [November 15, 2020, 12:19pm UTC](https://forums.unrealengine.com/t/change-hdri-cubemap-on-the-fly/474500/1 "2020-11-15T12:19:39Z")

</div>

Hi all,  
I am trying to take multiple automated snapshots of mesh assets with different HDRI backdrops in the background.  
I did not manage to find a way to switch the cubemap of my backdrop actor into a different one in mid-game.  
Tried both of the available functions shown in the snapshot, but both do nothing at all. The name is printed when I press F so I know that the flow does work.  
What am I missing here? Is there another function or maybe a re-initialization to be done after switching the asset?  
Many thanks,  
Tim

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [November 15, 2020, 1:57pm UTC](https://forums.unrealengine.com/t/change-hdri-cubemap-on-the-fly/474500/2 "2020-11-15T13:57:14Z")

</div>

I don’t know how you’re doing the HDR, but if you use the UE plugin, you can change it like this:

 ![322113-screenshot-2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/0/7/b076bd347e37632589cb36bd7c5303bb58e65b61.jpeg)

PS: You didn’t leave any pictures.

EDIT: I take that back, it doesn’t work…

---

<div class="post-metadata">

**Author:** ![Idantim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Idantim](https://forums.unrealengine.com/u/Idantim)\
**Post date:** [November 19, 2020, 5:34am UTC](https://forums.unrealengine.com/t/change-hdri-cubemap-on-the-fly/474500/3 "2020-11-19T05:34:02Z")

</div>

![322079-hdri-cubemap-bp.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/0/6/7066a501d42997ccb19e35a92f85263e33c4d30e.png)

---

<div class="post-metadata">

**Author:** ![Idantim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Idantim](https://forums.unrealengine.com/u/Idantim)\
**Post date:** [November 19, 2020, 5:40am UTC](https://forums.unrealengine.com/t/change-hdri-cubemap-on-the-fly/474500/4 "2020-11-19T05:40:55Z")

</div>

This forum has always been super weird. I did leave a comment after the questions but it seems to have disappeared…

 ![322079-hdri-cubemap-bp.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/0/6/7066a501d42997ccb19e35a92f85263e33c4d30e.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [November 19, 2020, 8:35am UTC](https://forums.unrealengine.com/t/change-hdri-cubemap-on-the-fly/474500/5 "2020-11-19T08:35:06Z")

</div>

I think the only way you can get it to work is preconfigure a bunch of skies, and spawn them one after another ( destroy the old one ).

---

<div class="post-metadata">

**Author:** ![Idantim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Idantim](https://forums.unrealengine.com/u/Idantim)\
**Post date:** [November 22, 2020, 8:23pm UTC](https://forums.unrealengine.com/t/change-hdri-cubemap-on-the-fly/474500/6 "2020-11-22T20:23:58Z")

</div>

Thanks, what I did was put a few of them in the world and toggle their “visible” or “hidden in game” depending on the script. just seemed like the wrong way to go about.

---

<div class="post-metadata">

**Author:** ![Idantim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Idantim](https://forums.unrealengine.com/u/Idantim)\
**Post date:** [December 15, 2020, 11:51pm UTC](https://forums.unrealengine.com/t/change-hdri-cubemap-on-the-fly/474500/7 "2020-12-15T23:51:45Z")

</div>

To anyone encountering this in the future, I have found the solution.  
When I saw that the same issue arises when rotating the HDRI, I opened up the HDRI BP and looked at the constructor.  
Apparently, there is an additional “post edit” step needed to be done, see attachment.

 ![324742-hdri-solution2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/a/d/4ad0214d24cac73857ae430ec65ff16e68db4fa4.png)

---

<div class="post-metadata">

**Author:** ![BojanglesTheLess](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BojanglesTheLess](https://forums.unrealengine.com/u/BojanglesTheLess)\
**Post date:** [March 6, 2023, 3:24pm UTC](https://forums.unrealengine.com/t/change-hdri-cubemap-on-the-fly/474500/8 "2023-03-06T15:24:06Z")

</div>

Ah, I was missing the `Create Material` node. Thanks!

---

<div class="post-metadata">

**Author:** ![MythyaVerse](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MythyaVerse](https://forums.unrealengine.com/u/MythyaVerse)\
**Post date:** [April 23, 2023, 4:17pm UTC](https://forums.unrealengine.com/t/change-hdri-cubemap-on-the-fly/474500/9 "2023-04-23T16:17:46Z")

</div>

Can you please share your blueprint code here? I’m still not able to change hdri background. It show the error trying to read “hdri variable’s” property and found none.
