I have just begun palying with Unreal Engine and as i am a Computer Science student i what to learn as mutch C++ as i can. So my question is how do i bind a Property or Function to a ProgressBar in C++. I have some what of a solution but i just can’t figure out the last pice of the puzzle. Here is the .cpp file of the widget class i have made.
As far as PlayerCharacter is a pointer: ALegendOfTroelsMegaTCharacter* PlayerCharacter; (long class name is long) it should work just fine. Do you get any errors during compilation or it just doesnt work? Can you paste ALegendOfTroelsMegaTCharacter::GetPercentHealth function?
the error i get is something like this: error C2664: ‘SProgressBar::FArguments::WidgetArgsType &SProgressBar::FArguments::Percent_UObject(UserClass ,TOptional (__cdecl ALegendOfTroelsMegaTCharacter:: )(void) const)’ : cannot convert argument 2 from ‘TOptional (__cdecl ALegendOfTroelsMegaTCharacter::* )(void)’ to ‘TOptional (__cdecl ALegendOfTroelsMegaTCharacter::* )(void) const’
I have tried to mess a little arround with the return value of the function to acomodate the error but here it is…