This is my current setup to getting current blueprint variable values from class. Is there a
way to do this but without spawning an actor to get the variable value? i feel there
is a much more simpler/efficient way to do this.
FActorSpawnParameters SpawnParams;
SpawnParams.Owner = this;
SpawnParams.Instigator = Instigator;
FTransform TempTransform;
AActor* const TempSpawnObject = GetWorld()->SpawnActor<AActor>(MyBlueprintClass, TempTransform.GetLocation(), TempTransform.GetRotation().Rotator(), SpawnParams);
if (TempSpawnObject)
{
ACustomActor* const CustAct = Cast<ACustomActor>(TempSpawnObject);
if(CustAct)
{
CustAct->ReadCustomVariableValue
}
TempSpawnObject->Destroy();
}
envenger
(envenger)
March 17, 2016, 9:59pm
2
This is my current setup to getting current blueprint variable values from class. Is there a
way to do this but without spawning an actor to get the variable value? i feel there
is a much more simpler/efficient way to do this.
FActorSpawnParameters SpawnParams;
SpawnParams.Owner = this;
SpawnParams.Instigator = Instigator;
FTransform TempTransform;
AActor* const TempSpawnObject = GetWorld()->SpawnActor<AActor>(MyBlueprintClass, TempTransform.GetLocation(), TempTransform.GetRotation().Rotator(), SpawnParams);
if (TempSpawnObject)
{
ACustomActor* const CustAct = Cast<ACustomActor>(TempSpawnObject);
if(CustAct)
{
CustAct->ReadCustomVariableValue
}
TempSpawnObject->Destroy();
}
I am currently on my system but there is a function like
ACustomActor->GetDefaultObject()
or something similar.
1 Like
Yeah, just found that out from the answer hub and it works Thanks for helping.