I want get location of the instance member in Foliage.
This is what I selected foliage in viewport and launch my function then return the instance’s location.
this is my code:
AActor* TargetActor = NULL;
AInstancedFoliageActor* CurrentIFA = NULL;
FString TargetName;
FString TargetLocation;
for (FSelectionIterator It(*GEditor->GetSelectedActors()); It; ++It)
{
TargetActor = static_cast<AActor*>(*It);
//CurrentIFA = static_cast<AInstancedFoliageActor*>(*It);
//CurrentIFA = (AInstancedFoliageActor*)TargetActor;
//CurrentIFA = Cast<AInstancedFoliageActor*>(*It);
if (TargetActor)
{
TargetName = TargetActor->GetName();
TargetLocation = TargetActor->GetActorLocation().ToString();
UE_LOG(ToolButtonModuleLog, Warning, TEXT("Name: %s, Location: %s"), *(TargetName), *(TargetLocation));
}
}
This code is only can get the Actor’s properties.
I was selected a Foliage launch my code then return <0, 0, 0> location. just one location.
I want each of the instance properties inside Foliage.
How can i get this.?
I was search in internet so many times but i can’t anymore.
help me plz.