How to bind a Slider UMG to a variable from another Blueprint?
I'm currently developing an application for architectural visualization and I'm struggling so hard with a question about programming my UMG on screen.
The thing is: I downloaded a day/night cycle in the market place and I set it up. In game it is changable with a variable which controls the rotation of the sun and the moon. I created a Slider in order to control that variable with the mouse cursor. So I just want to know how to bind this variable to the Slider in order to make the user be able to control the cycle ingame.
I have two Blueprints: One for the UMG were the slider is placed, and another with all the day/night cycle programming.
Now I'll upload some screenshots of the most important parts (I think they are) in order to solve this.
As you can see here, I set up a OnValueChanged function for the Slider, and with this I get to change the value of the slider with the mouse, but not the value of the variable I need.
Here you see I created a function where I scaled the range of the slider between 0 to 2400 (the cycle range controlled by the variable I need to dynamically change also goes from 0 to 2400).
And finally, here's the variable I need to change. This is the Blueprint from the Day/Night cycle I downloaded at the Marketplace. I think it's the most relevant part of this blueprint but I don't know if it's even needed to just know how to change with the slider a variable from another BP... right?
Thank you so much in advance for any help, everyone!!
Do you need to have this slider in a separate actor? Why not create the widget in the Day/Night cycle actor? Just asking, you may have a very good reason to keep them apart.
Generally speaking, it's a matter of obtaining a reference. You need a widget to gain access to the Day/Night actor and make the widget's slider set Day/Night actor's variable.
Follow this question
Once you sign in you will be able to subscribe for any updates here