Hello,
I am currently in the process of updating a few of my plugins to 4.20 and I’ve almost everything working fine, except for this one weird issue. To give a summary of what I’m trying to do, basically, in my VR app, I have an actor that spawns as a preview of where the player will teleport. It is created when the motion controller track pad is pressed and should be destroyed on release.
The creation part works fine, and the event for the button release is working as the log macro is printing to the output log. Below is the function implementation:
void AGenericMotionController::DeactivateTeleport()
{
if (TeleportPreview)
{
UE_LOG(LogTemp, Warning, TEXT("I would like to destroy %s"), *TeleportPreview->GetName());
TeleportPreview->SetActorHiddenInGame(true);
TeleportPreview->Destroy();
TeleportPreview = nullptr;
}
bTeleportActive = false;
ClearArc();
}
And the method definitely runs, as I get the log message:
However, the actor remains rendered in the scene, even through it appears to have been removed from the world outliner. I’ve posted the entire editor in the screenshot so that you can see that there is not actor in the outline named BP_TeleportPreviewActor, but the mesh remains in the scene despite this.
When I eject from the pawn, I can click on the mesh and it populates the details pane:
If I run destroy from the preview actors tick, begin play or the motion controller’s tick, it is destroyed normally including the mesh, but if it is called from the handler for the release event, it simply does not work. I even tried making a blueprint implementable event that would be called on the blueprint actor, but again, it runs the log I places in the event handler (this time on the blueprint side) and does not destroy the actor.
Something even weirder is that if I move the actor after pressing the button again, the previous one appears to have been destroyed.
I’m definitely scratching my head on this one, and if anyone has any idea of where I can go next, I would greatly appreciate it. Thank you in advance!