How to get my DataAsset in C++?

I don’t know if that’s what you need, but maybe it’s like a puzzle piece.
Response to: How do I create a DataAsset in Blueprint and use it in C++?

  1. Create a DataAsset in C++
  2. Based on it, create a DataAsset in Blueprint
  3. use it in the code as in the example below

include “MyCPPDataAsset.h”
MyCPP_DataAssetClass* DATest = LoadObject<MyCPP_DataAssetClass>(nullptr, TEXT(“/MyPluginTest/DA_MyCPPDA_BPVersion.DA_MyCPPDA_BPVersion”));
if (!DATest ) //checking
{
GEngine->AddOnScreenDebugMessage(-1, 16.f, FColor::Red, TEXT(“DA ERROR”));
return;
}
if (DATest->MybVarInDA)
{
some code making delicious rice
}

How I get the correct path to the DA: in the UE content browser, RCM on the DA and select “Copy Reference”, the second part of the copied text is the path.