Hello,
I have an issue casting a class then using the cast in a child class, here is some pseudo-code to explain:
In the header file of the class Im casting in:
UPROPERTY(EditDefaultsOnly, Category=MyCategory)
class TSubclassOf OtherClass;
protected:
UPROPERTY(EditDefaultsOnly, Category=MyCategory)
class AMyOtherClass* Other;
In the class Im casting in:
OtherClassClass = AMyOtherClass::StaticClass();
FActorSpawnParameters SpawnInfo;
AMyOtherClass* Other = GetWorld()->SpawnActor(OtherClass, SpawnInfo);
if(Other)
{
...
}
Now that cast works perfectly fine, but then I go into the child class and type
if(Other)
{
...
}
It fails. Am I doing something wrong when casting? Or is there something special I need to do to access it from the child class?
Thanks!
~Adam