Reading variable from User Defined Struct in c++
I made Structure in Unreal's interface and referenced it with "UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Animations) class UStruct* Struct_Animations;" in header. (and assigned it from within Unreal) Now, how can I access one of the variables from that struct in some function in .cpp? It's a beginner's question, I know, but I just don't know where to look for an answer.
asked Mar 22 '18 at 06:47 PM in C++ Programming
First of all UStruct contains type of stuct not struct it self same as UClass. You would need to read property of the UClass of blueprint and then read the struct data using UStructProperty and read it off properties same way you do from class, here example of reading properties over here:
Or you can do it a lot easier way.... just delere struct in C++, then you can easily keep it in varable in C++ and use it as Blueprint struct in in same time (BlueprintType makes struct usable in blueprints as a type)
and then just make varable
Follow this question
Once you sign in you will be able to subscribe for any updates here