I made a player health system in my character BP With various Variables and functions, And also a UMG widget that was casting to the player character BP to get those variables so it could update the health bar values and such. Everything worked perfectly
But I am changing to using Player controllers for my characters now, and thought I would like to make my health system a more modular stand alone component that I could just add to any actor and also reuse it in other projects down the line.
So I Migrated all those functions and variables to an actor component, But Im having a hard time casting from the UMG widget to the actor component.as everything I try to set as the target on the Actor component cast node is giving me errors. and Im not sure what the issue is.
try to get owner / actor / parent everything fails so the status bars are not updating :(.
I have also tried sending those varibles directly to the UMG widget from inside the actor component.
Also quick question regarding best practices and performance, Is it better to cast from the UMG to and actor to get the variable values or better to cast the varibles from the actor to the UMG.
Or does this not have any pros or cons and its just the same.