Hi Guys,
I have a property on my character for apparel, this item is set in blueprints so the designer can set the item to adorn the character with. The code for this in the header file is:
UPROPERTY(EditAnywhere, Category = “Character Accessories”)
TSubclassOf AccessoryHat;
I then instantiate the item like this:
AIGCAccessory* HatAccessory = ()->SpawnActor(AccessoryHat, FVector::ZeroVector, FRotator::ZeroRotator, Spawnparams);
if (HatAccessory)
{
HatAccessory->SetOwner(this);
HatAccessory->AttachToComponent(GetMesh(), FAttachmentTransformRules::SnapToTargetNotIncludingScale, HatSocketName);
HatAccessory->SetActorScale3D(ItemScale);
}
My question is how do i access the AccessoryHat blueprint to run functions on it, for example detaching it from the character. In the above code example if i expose the HatAccessory value i can run functions on it, but is there a way to do this directly on the TSubclassOf AccessoryHat variable.
Thanks