How to simple swap meshes by widget button?

Hi,

I’ve made a simple widget with 3 buttons to swap meshes, 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 beginer with blueprints. Is it posible to show how to do it in simple way?

There is a bunch of ways to do this, since i’m not sure about your setup i will just describe a simple example through Level BP:

  1. Make a Widget with your buttons, Make Event Dispatchers for those buttons and call to them when you click each button.
  2. In the level BP, Create that widget and add to viewport, and then assign and bind each of those Event Dispatchers, so when you click on a button, the event connected to that button will fire.
  3. Add your swap logic depending on which event has fired, for example if Mesh1 executes make mesh 1 Visible and others invisible.

thanks for answer but i dont know how to make a swap mesh logic in graph, i am completely newbie in blueprints, i tried a lot combinations and still doesnt work as expected. I’m doing something wrong but dont know what exactly

thanks for answer, i just want to change mesh from 1 to 2 by widget button, when i press button 1 i get mesh 1, press button 2 > mesh2 ect.
please see screenshots how i did it, maybe some wrong…

But when you say swap mesh, what exactly do you mean, do you have a static mesh component in a blueprint or something?

Because if so, click and drag out from that static mesh component onto the graph to create a reference, then from it drag out and typ set static mesh and frmo there you can set what static mesh it should be.

I highly recommend watching intro to ue4 tutorials as well

You are using If Branches that doesn’t have a statement to the, and what is connected to false will never run.
Connect them like i draw out in this picture, you don’t need the if branches for what you are trying to do.

And again, watch introduction to unreal and programmering tutorials because this is very basic things, there are alot of free ones on youtube and cheap ones on Udemy.