Change Static meshes using Widget button Blueprint

Hello Everyone,

I’ve made a simple widget with 3-4 buttons to swap my Objects (Static meshes) in my architectural scene, I saw a lot of tutorials but didn’t find correct one for me I can’t find way to swap meshes by widget button. I just want to swap static mesh by buttons which is in widget. I am really beginner with blueprints. Is it possible to show how to do it in simple way?

Please Help Me! or give me ref video…

Hi Ajay,

Using ‘Get All Actors of Class’ should be used with care (never on tick), and there are better ways to set references. BUT this should at least get you started with the functionality.

Idea here is that your ‘dynamic/mesh changing’ object is a Blueprint actor with functions (Custom Event nodes) to change the mesh. (The next level of this idea would be creating functions that take a static mesh as an input)

Let me know if anything is unclear, welcome to the forums!

2 Likes

Hey @Ajay_Pande007! Welcome to the Forums!

To add on, you can also change your meshes by setting up actors with a default mesh that you can swap out. For example, you can have your actor with your default mesh with an array of static meshes and an integer variable that can be used to reference those static meshes. Here is how to set that up:

From there, you just need to change the reference number by having your widget set the value.

For a more in depth look at setting up Set Static Mesh, here is a great non Epic affiliated video:

Changing static Mesh in an actor UE4 Blueprint

I hope the above solution works for you!

1 Like

@Quetzalcodename @Astrotronic Thank you so much for your answers it would be really great if you could refer me some links of videos as i am in the learning stage, I tried implementing the suggestion received but there is some error from my side so just wanted some references

Thank You !!!