I am trying to get the Slider value from the widget so it can change my new time on the timeline.
The UI variable is set as UI_Ship_Selection Object reference.
My cast failed and i cannot get the slider value please help as i am new to Unreal Engine.
Hi, first here how casting reference work (in a simplify way)
BP (including widget bp) asset in your content browser are like non living things and are called Class(with the pin color purple).
When you drag and drop or spawn a BP asset into the level map, it become alive which are called Actor (with blue pin), it will also has a reference id, this id is assigned to the memory with the name BPMyName_0. If we respawned that same BP asset, it will be BPMyName_1. This is called instance of a class.
Now your variable UI need to store an actual value that is alive in the memory just like the screenshot below. (then you wouldnt need a casting in that case)
Try to create your widget ShopSelection then store it to a variable in a event begin for example.
And then try your slider.
I manage to get the slider value now, i just now need to find a way to keep it update every time the slider are interact with as right now it only take the value once (because Beginplay maybe).
I am gonna try either the event tick or create custom event
Thank you so much to @Arodi007 i manage to get the UI work as i wanted using the Bind Event. Thank you so much. All your explanation is easy to understand.