Try to use Project World Location To Screen in editor mode


i try to get the **ProjectWorldToScreen **from the active camera. (not from the player )
because i need to use on the editor.

and actually for the ProjectWorldLocationToScreen need a APlayerController
and if i understand correctly, is active only on begin play so is null on the editor

How can i get a screenSpace vector from the current camera in editor mode ?

can i convert the camera to a player ?

i be able to getting the active camera

auto world = GetWorld();
UE_LOG(LogTemp, Warning, TEXT("GETWORLD start "));
if (world == nullptr)

UE_LOG(LogTemp, Warning, TEXT("GETWORLD OK "));

auto viewLocations = world->ViewLocationsRenderedLastFrame;
if (viewLocations.Num() == 0)
UE_LOG(LogTemp, Warning, TEXT("num Win : %d "), viewLocations.Num());
FVector camLocation = viewLocations[0];

UE_LOG(LogTemp, Warning, TEXT("SCREEN POS %s "), *camLocation.ToString());

static [bool]( ProjectWorldToScreen
[APlayerController]( const * Player,
    const [FVector]( & WorldPosition,
[FVector2D]( & ScreenPosition,
[bool]( bPlayerViewportRelative

Thank you very much for your help
Best Regards

Hello, have you solved your problem? I also need this feature.