Making a mesh invisible by clicking on a widget?

Hey everyone. I’m really new in UE. Is ist possible to make a mesh insivible by clicking on a Widget with the left mousebutton? I am trying this for days but I can’t find any solution. XD

Ich hope someone can help me.

There is on or another way, depending on the extend and what you want to do. I can tell you the dirty solution. Do you this for only one mesh, or do you want this for multiple meshes? Here is the solution for only one mesh, if you want to use this multiple times, just say so :wink:

First of all, I would make an Actor Blueprint and use this instead of your mesh. Then you can add a “Custom Event”, call it “Hide” or whatever. Drag your mesh into the event graph and call the function “Set Hidden” and click the “new hidden”.

Then go to your Widget, add a ButtonOnClick Event or whatever it is called and add a “Get all Actors of Class” with your BP, use a ForEach Loop and call “Hide” for each element.

Oh god, I’m talking to much, here are some pictures. Oh, I forgot to set the link between “Array Element” and “Target” at the “Hide” call

Oooooooooooooh yes! Thank you very much. You saved my day. I am working on a project for our company and now it is going forward. Thank you so much. What a perfect tutorial. But to be honest, I have no idea what I was doing. :smiley:

It was an honour.

Then set the problem as solved here :wink: