# How to make a slideshow on a StaticMeshComponent in BluePrint?

**URL:** <https://forums.unrealengine.com/t/how-to-make-a-slideshow-on-a-staticmeshcomponent-in-blueprint/473161>\
**Category:** Rendering\
**Tags:** list, image-plate, unreal-engine, Array, question, Blueprint\
**Created:** [October 19, 2020, 2:18pm UTC](https://forums.unrealengine.com/t/how-to-make-a-slideshow-on-a-staticmeshcomponent-in-blueprint/473161 "2020-10-19T14:18:38Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_778acb921](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_778acb921](https://forums.unrealengine.com/u/anonymous_user_778acb921)\
**Post date:** [October 19, 2020, 2:18pm UTC](https://forums.unrealengine.com/t/how-to-make-a-slideshow-on-a-staticmeshcomponent-in-blueprint/473161/1 "2020-10-19T14:18:38Z")

</div>

Hello!

Is there a way to make a slideshow on a StatichMeshComponent in BluePrint? I want to display a slideshow for the player/user in the world, of different pictures, but I just can’t come up with a solution.

It should be like a list / array of images that you switch between with BP. I’m thinking, to switch the materials that you can get from the images with some SetMaterial, or something similar, on a StaticMeshComponent.

Do you guys have any solutions?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 19, 2020, 3:53pm UTC](https://forums.unrealengine.com/t/how-to-make-a-slideshow-on-a-staticmeshcomponent-in-blueprint/473161/2 "2020-10-19T15:53:04Z")

</div>

- have a material with an exposed parameter

 ![319273-mat.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/0/9/e090624ca5cd293961439cde935dfb7118a0fce9.jpeg)

- create a dynamic material instance (top)

 ![319274-cycle.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/3/3/a33595eb0902a76055bf2bc9f209d9c5390bc4a8.jpeg)

- use a timer to iterate through the array and feed its element to the material instance (bottom)

Would that work for you?

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/b/6/1b65012f56946a90b43e9b156cf8110ae6c699cc.gif)](https://gyazo.com/be9b0ccb907d9ac2f4fdd2ee03cd62bf)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_778acb921](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_778acb921](https://forums.unrealengine.com/u/anonymous_user_778acb921)\
**Post date:** [October 19, 2020, 6:43pm UTC](https://forums.unrealengine.com/t/how-to-make-a-slideshow-on-a-staticmeshcomponent-in-blueprint/473161/3 "2020-10-19T18:43:37Z")

</div>

Wow, thanks for the reply. I didn’t expect that. But what do you mean by “have a material with an exposed parameter”? And you only create that material once, right? Not one for every image.

Another qustion, in the second picture (in the Blueprint), you have a “Set” node in-between “Create Dynamic Material Instance” and “Set Timer By Event”. What Set node is that? There are so many different types of Set nodes.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_778acb921](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_778acb921](https://forums.unrealengine.com/u/anonymous_user_778acb921)\
**Post date:** [October 19, 2020, 6:57pm UTC](https://forums.unrealengine.com/t/how-to-make-a-slideshow-on-a-staticmeshcomponent-in-blueprint/473161/4 "2020-10-19T18:57:35Z")

</div>

I can also see that you’ve created variables “Images” and “Next Image”, right? And is the Images variable of type “Texture2D, Object Reference” or “Texture2DArray, Object Reference”?

I can’t bring up the Array elements when trying to create a “Texture2D, Object Reference” variable. I can only choose one picture there.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 19, 2020, 8:05pm UTC](https://forums.unrealengine.com/t/how-to-make-a-slideshow-on-a-staticmeshcomponent-in-blueprint/473161/5 "2020-10-19T20:05:40Z")

</div>

> “have a material with an exposed  
> parameter”? And you only create that  
> material once, right? Not one for  
> every image.

Once is enough, instanced dynamic materials can be modified during run-time. So you get away with having 1 material and pipe in data modifying it. You can create a texture parameter by holding ‘t’ and left clicking in the graph, then right click that node and convert it to a parameter - the name is important, we’ll use it later to send a texture this material will use:

 ![319309-param.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/9/f/09ff60984b0cce0380f916bf6b316832e857a1b6.jpeg)

You will need to give the parameter a default texture value in the details panel; otherwise, it will complain.

> you have a “Set” node in-between

One can Get (read from) or Set (write to) variables. In this very case, the DMI (named after Dynamic Material Instance) holds a reference to an instance of a dynamic material we’ve just created. I’m setting this variable to the return value of the _Create Dynamic Material Instance_ node - we need to access this material later on in order to send it a new texture to use. A reference like this allows for it.

An easy way to to create reference _of the correct type_, is to right click a pin and Promote to Variable:

![319294-prmo.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/b/b/abba26ba7cc6af08562d79bc1323a9259ae69986.jpeg)

> And is the Images variable of type  
> “Texture2D, Object Reference” or  
> “Texture2DArray, Object Reference”?

It’s an array of Texture 2D:

![319293-images.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/8/b/b8ba48dc4822eedd2c347208fff5cb29f14f3509.jpeg)

> I can’t bring up the Array elements  
> when trying to create a “Texture2D,  
> Object Reference” variable. I can only  
> choose one picture there.

You will need to turn this variable into an array. The first red dot above.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 19, 2020, 8:18pm UTC](https://forums.unrealengine.com/t/how-to-make-a-slideshow-on-a-staticmeshcomponent-in-blueprint/473161/6 "2020-10-19T20:18:02Z")

</div>

> I can also see that you’ve created  
> variables “Images” and “Next image”?  
> Right? And are they both located  
> within the BP of the aDisplay?

Yup, it’s all self contained. This way you can have many actors, each with an array of unique images cycling them at different speeds.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_778acb921](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_778acb921](https://forums.unrealengine.com/u/anonymous_user_778acb921)\
**Post date:** [October 19, 2020, 8:33pm UTC](https://forums.unrealengine.com/t/how-to-make-a-slideshow-on-a-staticmeshcomponent-in-blueprint/473161/7 "2020-10-19T20:33:44Z")

</div>

Thank you so, so, so much for your comprehensive answers and careful descriptions. How little would I know thatm in order to create a reference to the correct type, is by right-clicking the pin and press “Promote to Variable”. Thanks bud!

the Your “Next Image” variable, is it an integer? I tried to use integer as the variable type, but it then asks for a default value (starts automatically with 0) when I want to add a Set (Next Image) node. I can’t see that you have done that.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 19, 2020, 8:40pm UTC](https://forums.unrealengine.com/t/how-to-make-a-slideshow-on-a-staticmeshcomponent-in-blueprint/473161/8 "2020-10-19T20:40:43Z")

</div>

It’s an integer, yes. The timer fires once per second and increases this int by 1 (++), the modulo (%) wraps this value back to 0 when we reach the end of the array.

In the end you’re getting a [0,1,2,3,4] sequence and the int pulls the appropriate element from the array which is then pushed into the material.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_778acb921](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_778acb921](https://forums.unrealengine.com/u/anonymous_user_778acb921)\
**Post date:** [October 19, 2020, 11:40pm UTC](https://forums.unrealengine.com/t/how-to-make-a-slideshow-on-a-staticmeshcomponent-in-blueprint/473161/9 "2020-10-19T23:40:11Z")

</div>

Thank you so much for all your help. You made my day. Wish you all the best.

---

<div class="post-metadata">

**Author:** ![MIDOLOSK](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MIDOLOSK](https://forums.unrealengine.com/u/MIDOLOSK)\
**Post date:** [October 27, 2020, 10:58am UTC](https://forums.unrealengine.com/t/how-to-make-a-slideshow-on-a-staticmeshcomponent-in-blueprint/473161/10 "2020-10-27T10:58:21Z")

</div>

Great tutorial! How do you add a fade between the Images to this one?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 27, 2020, 10:59am UTC](https://forums.unrealengine.com/t/how-to-make-a-slideshow-on-a-staticmeshcomponent-in-blueprint/473161/11 "2020-10-27T10:59:20Z")

</div>

Lerp between 2 textures.

---

<div class="post-metadata">

**Author:** ![MIDOLOSK](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MIDOLOSK](https://forums.unrealengine.com/u/MIDOLOSK)\
**Post date:** [October 27, 2020, 11:02am UTC](https://forums.unrealengine.com/t/how-to-make-a-slideshow-on-a-staticmeshcomponent-in-blueprint/473161/12 "2020-10-27T11:02:01Z")

</div>

So I create a second “ImageToShow” and lerp them and animate the Alpha? But where and how do I connect it into the blueprint?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 27, 2020, 11:08am UTC](https://forums.unrealengine.com/t/how-to-make-a-slideshow-on-a-staticmeshcomponent-in-blueprint/473161/13 "2020-10-27T11:08:08Z")

</div>

You’d need 2 texture samples in the material. Instead of pushing 1 texture, you push in 2.

Promote the Timer return value to a variable and use the handle’s elapsed / remaining time to drive the alpha in the material.

That should be it, I think.

---

<div class="post-metadata">

**Author:** ![MIDOLOSK](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MIDOLOSK](https://forums.unrealengine.com/u/MIDOLOSK)\
**Post date:** [October 27, 2020, 11:14am UTC](https://forums.unrealengine.com/t/how-to-make-a-slideshow-on-a-staticmeshcomponent-in-blueprint/473161/14 "2020-10-27T11:14:08Z")

</div>

I changed the setup a bit so I can use keyboard commands to go back and forth between the images.  
I promoted the lerp(Blend) Value and will use the set scalar parameter value to drive it, right?  
I don’t know how and where to connect it though…  
Thanks for replying so fast =)

 ![320258-bp.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/3/2/53251c5a0c75923d0aa4d792ce23a156438b9705.jpeg)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 27, 2020, 11:28am UTC](https://forums.unrealengine.com/t/how-to-make-a-slideshow-on-a-staticmeshcomponent-in-blueprint/473161/15 "2020-10-27T11:28:19Z")

</div>

I did it like this:

 ![320259-screenshot-2020-10-27-112235.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/3/b/43b45c8a4b0a9b0ac3fda073daf17f6e0cdae33b.jpeg)

![320260-screenshot-2020-10-27-112301.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/2/f/12f5137cf06f6697e4015dfc36be763bededf5ab.jpeg)

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/4/e/34e0b445822556ad9f63a0115ed602ad62678049.gif)](https://gyazo.com/f8af93e416b2087d9d70ae44ebe05d08)

* * *

But you must be super close; if you want a smooth transition, you will need to generate alpha somehow. A timer is a good option as it gives you plenty of control and it can be then sampled on Tick.

In your case, a timeline would work better, actually!

---

<div class="post-metadata">

**Author:** ![MIDOLOSK](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MIDOLOSK](https://forums.unrealengine.com/u/MIDOLOSK)\
**Post date:** [October 27, 2020, 11:36am UTC](https://forums.unrealengine.com/t/how-to-make-a-slideshow-on-a-staticmeshcomponent-in-blueprint/473161/16 "2020-10-27T11:36:48Z")

</div>

Thanks for your help! I will try to get it to work. Take care!

---

<div class="post-metadata">

**Author:** ![MIDOLOSK](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MIDOLOSK](https://forums.unrealengine.com/u/MIDOLOSK)\
**Post date:** [October 29, 2020, 7:06am UTC](https://forums.unrealengine.com/t/how-to-make-a-slideshow-on-a-staticmeshcomponent-in-blueprint/473161/17 "2020-10-29T07:06:50Z")

</div>

That’s awesome! Thank you for your tutorial. How would you add Fading from one Image to the next to this one?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 29, 2020, 9:49am UTC](https://forums.unrealengine.com/t/how-to-make-a-slideshow-on-a-staticmeshcomponent-in-blueprint/473161/18 "2020-10-29T09:49:23Z")

</div>

There might be a better way but this seems to work ok, providing the goal is to cycle through the content both ways:

 ![320486-fwdbck.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/6/9/669dd4f0dc19636ba2671108d500483d7783e7c1.jpeg)

In short, figure out the Current | Next array elements needed depending on the direction, pull them out of the array and push them into the material.

You may need to find a better way to handle the initial numbers.

---

<div class="post-metadata">

**Author:** ![MIDOLOSK](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MIDOLOSK](https://forums.unrealengine.com/u/MIDOLOSK)\
**Post date:** [October 30, 2020, 12:38pm UTC](https://forums.unrealengine.com/t/how-to-make-a-slideshow-on-a-staticmeshcomponent-in-blueprint/473161/19 "2020-10-30T12:38:21Z")

</div>

Thanks! I will give it a try.
