Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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

Product Version: UE 4.7
more ▼

asked May 25 '15 at 01:07 PM in Blueprint Scripting

avatar image

1 1 2 1

avatar image Narghile May 25 '15 at 01:34 PM

HI Mate

Is it one BP or Many?


avatar image Animaphic May 25 '15 at 01:55 PM

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.

avatar image Ghar May 25 '15 at 02:43 PM

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: alt text

in your widget: alt text

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

img1.png (126.1 kB)
img2.png (53.5 kB)
avatar image Animaphic May 25 '15 at 03:51 PM

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 ;) 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 object reference - static mesh actor? I've tried all the variable types and can't seem to find it :(

thanks again for the help

avatar image Animaphic May 25 '15 at 08:09 PM

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 :)

avatar image McPhearson May 27 '15 at 08:06 AM

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

avatar image Animaphic May 27 '15 at 08:12 AM

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 :)

avatar image Animaphic May 27 '15 at 12:39 PM

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):

alt text

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

alt text

Slider display is contained within FirstPersonCharacter BP:

alt text

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

avatar image Animaphic May 27 '15 at 12:40 PM

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

alt text

sliderdisplay.jpg (51.3 kB)
avatar image McPhearson May 28 '15 at 12:54 PM

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. alt text I'm thinking it's to do with the world locations, I tried both of these ones one at a time as well but I never even see communication between the Mover_CE and the world location? alt text

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

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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.

alt text

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

alt text

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

alt text

final_widgetbp.jpg (18.6 kB)
final_actorbp.jpg (39.0 kB)
final_levelbp.jpg (125.9 kB)
more ▼

answered May 28 '15 at 03:06 AM

avatar image

1 1 2 1

avatar image Ghtrsa Jan 28 '19 at 03:51 PM

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

avatar image Nebula Games Inc Jan 28 '19 at 05:39 PM

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

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question