Hi sorry to bother you guys, but I am struggling to get this work following documentation as I am just learning c++. I do imagine this will be a 2 min job for C++ guy.
Basically in BP I can make little func:
Input: Soft Reference Object
Output: AnimMontage
Function: Input(softRef)->Load Asset Blocking->CastToAnimMontage->Return(AnimMontage)
Q 1.)Would you be so kind and translate this to C++ for me? If it’s possible.
my guess it will be something along these lines???:
UFUNCTION(BlueprintCallable, Category = “Animation”)
UAnimMontage* LoadAnimMontageSoftRef(TSoftObjectPtr SoftObjectPointer);
UAnimMontage* ARPGCharacter::LoadAnimMontageSoftRef(TSoftObjectPtr SoftObjectPointer)
{
if (SoftObjectPointer.IsPending())
{
const FSoftObjectPath& AssetRef = SoftObjectPointer.ToStringReference(); //not sure really just seen this in doc???
SoftObjectPointer = Cast< UAnimMontage>(NotSureWhat, as doc example doesn’t work);
}
return SoftObjectPointer.Get();
}
Q 2.)In testing it’s not hitching at all. Will this be a problem in full scale published single player game? Kind of it says in comment no problem for small assets. But what is small asset in PC published platform?
Q 3.)Do I understand it correctly that I don’t need to unload soft obj pointers as they will be garbage collected automatically once the animation will finish?
Q4.)Would same apply per Particle System, Niagara, Sound or there are more concerns?
Many Thanks in advance for your time.