I have no idea about the code, but just from the error message:
If it is an object that comes with UE: It sounds like you have to use a “Getxyz()” function for whatever variable you are trying to access instead of just getting it directly.
If it is your own created code: You probably put something in private that you should make public or create a getter for.