I’m confused onto why certain declarations allow me to see them in my Blueprint Editor and some do not. Here are examples, if anyone could tell me what I’m doing wrong that’d be great. Using Unreal 5.1
For the components, did you actually create them and assign them in the Constructor?
// In the Constructor of the class
JustAMeshObject = CreateDefaultSubObject<UStaticMeshComponent>(TEXT("JustAMeshObject"));
JustABoxObject = CreateDefaultSubObject<UBoxComponent>(TEXT("JustABoxObject"));
To be specific, I have a weapon mesh object that I added through the Blueprint Editor using the “Add” button. I now want my C++ class to know that reference so I’m assuming I should be able to create a reference field in C++, so I can drag and drop it into the field like what I am doing with my UAnimationMontage. Fairly new to Unreal, lemme know if this is not allowed and if I should create the object through the constructor instead.
Ok, I don’t think you can drag and drop the Component to the variable. You’ll have to set it on Begin Play (There’s probably other ways that I don’t know. Also, don’t forget to change BlueprintReadOnly to BlueprintReadWrite for the component variables.)