Control the visibility of a blueprint actor with a slider

Hello,
there are two different blueprints actors. I would like to control the visibility of the blueprints actors with a slider. By moving the slider tick, actor A starts to disappear while actor B appears little by little.
I know it can be done by controlling the material, but is there any other way to do it, for example using the set visibility node or something similar?
Thanks in advance,
Gerard

I just re-read your post. No, you have to do it in the material :slight_smile:

OK. So, is there a way to “load” a blueprint actor in each step of the slider?. For example, a slider with min value 0, max value 3 and step size 1, which is a slider with 3 steps. In step 0 we have 3 blueprint actors superimposed as layers. In the next step, the actor in front disappears. And in the last step the next actor disappears leaving the actor below in view.

You could do this, I guess. What’s the problem with doing it using a material?

It would probably be easier to make it one BP actor, with several mesh components. You can change the visibility of the components as the slider moves.

The problem with using a material is that I have several meshes with a multi-material sub-object and I would have to control several parameters, getting a very large blueprint logic, I think. So I was thinking of making one mesh disappear in each step of the slider.
You talk about having all the meshes in a single BP actor, but how do you change the visibility of the components as the slider moves?

The visibility does need to be controlled through a material ( or materials ).

If you have a lot to control on a lot of meshes, you might want to look at parameter collections.

If it’s a smaller number of materials / meshes, then putting everything in one BP might make sense, because then it’s all accessible.

Add them to an array in the desired order, have the slider step through the array and set visiblity.

I think there might be a bit of confusion here. @Gerard979_3D are you talking about Visibility only? Because when you say:

By moving the slider tick, actor A starts to disappear while actor B appears little by little.

It does sound like translucency, indeed - for which you would absolutely need materials.

If you want components / actors pop in / out of view instead, this could be done with just setting visibility and / or material.

Sorry for my ignorance, but how do you make an array to apply it to a slider? Could you guide me a little bit?
Thanks

how do you make an array to apply it to a slider?

Put stuff in an array, have the slider fetch it by index:

This is just an idea, you’ll need a bit more script to make it work properly.


Note that if you’re working with layers - here just a scene component with some meshes attached:

image

You can propagate Visibility:

image

This would affect all attached children. Fine for 5 or so layers only, you may not even need an array. If you have 50 layers, you’ll need to structure things better, ofc.

Hello,
everything seems to work correctly except 2 things.

  • Although the slider works fine, an error message appears.

  • The slider only responds in one direction (left to right). When I move the slider from right to left, the meshes would have to reappear. I have tried with branch or flip flop nodes, but I can’t find the solution.

Thanks for your help.

The array index 0 is null, slider exceeds array bounds - most likely. Either populate the array properly or ensure the slider outputs acceptable values.


When it comes to making it work both ways, if you do not want to invest in mathing it out, you can always brute-force run a ForEach loop comparing array indexes against slider values. For short loops the performance impact would be negligible.


Here’s what I mean:

  • widget:

image

  • array elements loop:

1 Like

Great!!..works perfectly!!!
Thank you.

Hi, a bit late to the party, but I have a question regarding this slider… I am also trying to get this working, but I can’t figure out how to define those ‘Static Mesh’-variables that are the input for the array… Bit of a rookie here, but could you explain how you do that exactly? Same with the layer groups… I added geometry in separate layers, but I can’t figure out how to call those in the slider blueprint…