How to hide show objects by widget?

hi what i want to do is to hide entiere object elements , from things like architecture parts to fog or other postprocess elements, in a single buton click , I was wondering if there is a way to add a tag to those stuff so that all items with thtat tag would get hidden in visibility on click and showed up again on second click , how can I do that in a widget?

Created this test setup in a widget. It gets all Actors with Tag and then, for toggling reasons, it checks the first selected actors ā€˜Hidden in Gameā€™ state to reverse it. (and for every other actor in the array too)
It is just a quick test ā€¦ the Get All Actors with Tag array could be stored after the first time and then re-used, so that there is no need to use the Get All everytime and so on ā€¦ the TEMPBool could be stored inside the widget or with a FlipFlop node ā€¦ really depends on the usage.

1 Like

thanks , I am not expert with this but how would I store or use flipflop?

I have like 50 items , they are all set into a folder, canā€™t I just link folder somehow?

This setup would toggle between New Hidden true and New Hidden false.

And Iā€™m not 100% sure, but I guess referencing to a folder is not possible. But if you select every Actor in your folder you can use the Details panel to search for ā€˜Tagsā€™ and edit them all at once.
image

2 Likes

Ok I tried but doesnā€™t work , nothing happens and the item remain visible ingame .

Can you show me screenshots of your setup? Widget and Actor Tags?

this is the image that shows part of the blueprint widget where I set up this ā€¦

this is the tag I added

Make sure you use Actor Tags (not Component Tags)

image

1 Like

Canā€™t really tell what node you are using due to lack of resolution, but I assume you are getting all actors by actor tag, but you assigned the toogle tag as component tag. IIRC they are different.

And I wouldnt store an extra boolean value into the objects, cause you can get the visible state as bool as default for every actor placed inside the world. So you are saving overhead.

1 Like

How I set an actor tag? Because under the Actor window I donā€™t see it available .

Edit: Ok I found by doing search fildering with tag, but coulnā€™t find otherwise, using the actor tag worked thankyou :slight_smile: .

A super simple way that works 100% is to just drag the components into the graph and connect them up to a ā€œset hidden in gameā€ node and just use a key binding to execute. You could also use ā€œset visibilityā€ and do the same. Simply use a flip flop switch and reverse the effect by in ticking ā€œnew hiddenā€ boolean I believe itā€™s called.

The benefit of hidden in game is that the components stop producing draw calls also as opposed to setting visibility they are still making draw calls even though theyā€™re invisible.

1 Like

I need them to continue cast shadow though even if hidden in game, which one is preferable then hidden or not visible?

I believe that neither will produce a shadow if they are hidden or invisibleā€¦ that may be something that needs to be done in the materials with transparency. I prefer hidden in game to save system resources when things arenā€™t in the scene, but that may not be what youā€™re going forā€¦

1 Like

What I want to do is actually this :

I have a building, I click on a button and I get a new camera that zooms on the top view of an office in the building, so I donā€™t want strange lightning inside the office that comes by having hidden roofs and all rest, I so disabled the exponential fog, that created fog inside the office , but I am not able to retune the light intensity seems and I get strange shadow regardless inside .

the actual light seems strange, but doesnt seem the same setting I have if I do manually , what I wanted to change is the lux intensity of the directional light inside the blueprint of the sun and sky positioning item .

edit: I used the wrong light intensity , I had to use instead the set directional light intensity .

I would recommend the tag way. But you can also implement function interfaces to you actors which handles the visibility or hidden state of your actors.

Oh and if you cant find the Actor tag attribute, check if you have selected the actor itself not a component.

2 Likes

You can use post process volumes to tune specific areas of your project regarding lighting without affecting other areas. You can have total darkness inside a volume and have intense lighting outside. Iā€™m sure you can do that with the fog as well. Itā€™s tricky, but it provides a lot of cool stuff if you have time to experiment with it.

problem is that I already have a big infinite postprocess volume , I coulnā€™t find a way to exclude one from the other .

Iā€™m new with unreal engine and searched this for 4 hours in forums and god sake canā€™t do this simple quest. Mine is easier than this. I have an fbx object and parented to metahuman head. I want to push a button in-game and hide this model. Nothing happened. What am I doing wrong?

You are setting it to show as soon as you release the key. Use a flip flop on the pressed only and switch between nodes.

1 Like

Are you saying It should work now ? Because It doesnā€™t. Pressed or released nothing happens.
I donā€™t know well how flip/flop switch works but still nothing.

image