How can I make a slider control the y position of a static mesh?

I have the slider set up and displayed with a print string to confirm the data coming out of the slider (in this case 0 to 100), I have a Blueprint actor with the static mesh I need to move. I’m fairly new to BP and UI so not sure how to get the data to the BP actor -is the blueprint in the Level BP? is it in the Actor BP? any help would be greatly appreciated, thanks

HI

Is it one BP or Many?

its a very simple game/BP, level starts and an invisible slider on the screen this slider will control the height of a plane with an ocean shader on it, so the slider will effectively control the tide - slide to the top of the screen it will be high tide, bottom of the screen will be low tide.

Have you tried using a Lerp? You could create a function that takes an alpha float value to set the Z location of the plane, then calling it in the OnValueChanged event of the Slider.

in your actor blueprint:

in your widget:

44070-img2.png

If you do it this way you would need a reference to the mesh in the Widget that has the slider.

thanks a lot Ghar for the reply, I’m nearly there on getting this working just a couple of questions and apologies if they are noob questions :wink: the 2nd node off the static mesh in the actor blueprint (the one with target and xy and z relative locations) I’m not sure how to get it - what is it called?

in the widget the the Plane Mesh - is that a reference - static mesh actor? I’ve tried all the variable types and can’t seem to find it :frowning:

thanks again for the help

figured out the first part with the target relative location node it was a transform variable get relative location, now all I need is the reference to the mesh in the widget and I’m done :slight_smile:

Could you go into more detail how to get the target relative location node? I search for Get Relative Location and none of them seem to have the xyz, just a single relative location

you pull a node off the static mesh, then search for Relative - its under variable - transform - Get Relative Location, right click on the relative location and go Split Structure Pin, thats it :slight_smile:

K, so, I think I’ve got it, but still not working:

Low value is a float variable set to 0, High value is a float variable set to 100, static mesh is a direct reference to the only static mesh in the Actor BP (called AH Geometry BP):

BP actor Ref is a reference variable referencing AH Geometry BP contained in the Slider Widget:

44276-widgetbp_try2.jpg

Slider display is contained within FirstPersonCharacter BP:

44277-sliderdisplay.png

Very confused and looking like Homer Simpson due to lack on sunlight and pulling my hair out :wink: any suggestions please?

Don’t know why Slider display didn’t display, here it is:

Found a solution using an event dispatcher.

Widget Setup with the OnValueChanged of the slider linked to an event dispatcher with a custom float input to link to the value output.

44372-final_widgetbp.jpg

Actor BP with a custom event and a float input linked to the Z of set world location

Assigning event dispatcher and linking to Mover_CE custom event from the Actor BP

Could you possibly help me with my version? It does not appear to be working. I am trying to use a paper character blueprint instead of a mesh, this may be what is causing it not to work. I named the player character “That Guy”, this screenshot is while I am moving the slider. It goes to mover_CE but then nothing.

I’m thinking it’s to do with the world locations, I tried both of these ones one at a as well but I never even see communication between the Mover_CE and the world location?

Finally here is the widget blueprint during the slider being moved, in case it helps.

Hi!!! sorry but how did you get the call mysliderchanged node?? i cant find it… thanks!!!

Looks like a custom function (event dispatcher) created in the slider widget that is then called from the actor BP