UWidgetLayoutLibrary::ProjectWorldLocationToWidgetPositionWithDistance

Convert a World Space 3D position into a 2D Widget Screen Space position, with distance from the camera the Z component.

Windows
MacOS
Linux

References

Module

UMG

Header

/Engine/Source/Runtime/UMG/Public/Blueprint/WidgetLayoutLibrary.h

Include

#include "Blueprint/WidgetLayoutLibrary.h"

Source

/Engine/Source/Runtime/UMG/Private/WidgetLayoutLibrary.cpp

Syntax

static bool ProjectWorldLocationToWidgetPositionWithDistance
(
    APlayerController * PlayerController,
    FVector WorldLocation,
    FVector & ScreenPosition,
    bool bPlayerViewportRelative
)

Remarks

Convert a World Space 3D position into a 2D Widget Screen Space position, with distance from the camera the Z component. This takes into account any quality scaling as well.

Returns

true if the world coordinate was successfully projected to the screen.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss